Project

General

Profile

Actions

Bug #95644

closed

favicon doesn't work in TYPO3 11.5.1 anymore / FilePathSanitizer problem?

Added by Wolfgang Kleinbach about 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2021-10-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:

Description

page.favicon.file (as a constant) und page.shortcutIcon (in setup) don't work anymore.

No favicon in output anymore.

Still works in TYPO3 11.5.0.

Perhaps this is caused by an error in FilePathSanitizer, which also didn't work as expected in some extensions:

GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize('EXT:myext/...'])

returns
/typo3conf/ext/myext/...

which "is not located in the allowed paths" (error message) and not the following string without the leading slash (as under 11.5.0):
typo3conf/ext/myext/...

Trying to add the $allowExtensionPath
GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize('EXT:myext/...'], true)

returns
EXT:myext/...

which is not working either.

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #95481: Configuring custom PageRenderer template can throw exceptionClosed2021-10-05

Actions
Has duplicate TYPO3 Core - Bug #95726: TS: shortcutIcon no longer resolves EXT-pathsClosed2021-10-22

Actions
Actions #1

Updated by Wolfgang Wagner about 3 years ago

Same problem here.

Actions #2

Updated by Florian Rival about 3 years ago

  • Complexity set to easy
  • Is Regression set to Yes

Same problem for me.

An easy way to resolve this is to remove the first slash before using strpos in method FilePathSanitizer::sanitize():

// Check if the found file is in the allowed paths
$relativePath = ltrim($relativePath, "/");
foreach ($this->allowedPaths as $allowedPath) {
    if (strpos($relativePath, $allowedPath) === 0) {
        return $relativePath;
    }
}
Actions #3

Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71804

Actions #4

Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71806

Actions #5

Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71806

Actions #6

Updated by Gerrit Code Review about 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71806

Actions #7

Updated by Gerrit Code Review about 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71806

Actions #8

Updated by Gerrit Code Review about 3 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71806

Actions #9

Updated by Gerrit Code Review about 3 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71806

Actions #10

Updated by Helmut Hummel about 3 years ago

  • Has duplicate Bug #95726: TS: shortcutIcon no longer resolves EXT-paths added
Actions #11

Updated by Helmut Hummel about 3 years ago

  • Related to Bug #95481: Configuring custom PageRenderer template can throw exception added
Actions #12

Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/71804

Actions #13

Updated by Helmut Hummel about 3 years ago

  • Status changed from Under Review to Needs Feedback

Can you please check out the fix and vote if it works for you?
Thanks https://review.typo3.org/c/Packages/TYPO3.CMS/+/71804

Actions #14

Updated by Florian Rival about 3 years ago

  • Status changed from Needs Feedback to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF