Bug #20153
closedshortcut icon type detection does not work if allow_url_fopen is disabled
0%
Description
The shortcut icon type detection in class.tslib_pagegen.php does not work if allow_url_fopen is disabled.
Reason:
The finfo_file function returns nothing (or a warning) if allow_url_fopen is disabled
and the second argument is an URL (which is the current state).
Here's my current workaround:
$favIcon = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']);
$favIconPath = PATH_site . $GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']);
$iconMimeType = '';
if (function_exists('finfo_open')) {
if (($finfo = @finfo_open(FILEINFO_MIME))) {
$iconMimeType = ' type="' . finfo_file($finfo, $favIconPath) . '"';
finfo_close($finfo);
}
}
(simply added $favIconPath and use this var in finfo_file instead of $favIcon)
Probably it would also be a better default using $iconMimeType = ' type="image/x-icon"' than the empty string
if the finfo_open function doesn't exist.
See also:
http://bugs.typo3.org/view.php?id=1537
http://bugs.typo3.org/view.php?id=5757
(issue imported from #M10650)
Files
Updated by Stefan Geith about 15 years ago
I added an anhanced patch, that
a) uses $iconMimeType = ' type="image/x-icon"' if the finfo_open function doesn't exist (from exisitng patch)
b) added solution with
$favIconPath = PATH_site . $GLOBALS['TSFE']->tmpl->getFileName($GLOBALS['TSFE']->pSetup['shortcutIcon']);
Updated by Stefan Geith about 15 years ago
Susanne Moog wrote:
<snip>
aren't you using the wrong "else" part if you want to set this if the
finfo_open function doesn't exist? (and the wrong variable?)
[...]
Additionally the "$iconMimeType = ' type="image/x-icon"';" should be
given to the pagerenderer ($pageRenderer->setIconMimeType($iconMimeType);).
</snip>
Attached improved patch (v4).
Updated by Alexander Opitz over 11 years ago
- Category deleted (
Communication) - Status changed from Accepted to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Michael Stucki) - Is Regression set to No
No feedback for over 90 days.