Actions
Bug #20153
closedshortcut icon type detection does not work if allow_url_fopen is disabled
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-03-10
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
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
Actions