Project

General

Profile

Actions

Bug #20153

closed

shortcut icon type detection does not work if allow_url_fopen is disabled

Added by Schmid Valentin about 15 years ago. Updated over 10 years ago.

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

bug_10650.diff (794 Bytes) bug_10650.diff Administrator Admin, 2009-04-30 13:16
010650-favicon-v2.patch (1.06 KB) 010650-favicon-v2.patch Administrator Admin, 2009-10-13 10:16
010650-favicon-v3.patch (1.17 KB) 010650-favicon-v3.patch Administrator Admin, 2009-10-19 09:49
010650-favicon-v4.patch (1.04 KB) 010650-favicon-v4.patch Administrator Admin, 2009-10-19 09:49

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #15013: shortcut icon syntax incorrect/incompleteClosedMichael Stucki2005-10-08

Actions
Related to TYPO3 Core - Bug #17367: Add mime type "image/x-icon" to shortcut iconClosedIngo Renner2007-06-07

Actions
Actions #1

Updated by Stefan Geith over 14 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']);

Actions #2

Updated by Stefan Geith over 14 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).

Actions #3

Updated by Alexander Opitz almost 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)?

Actions #4

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Michael Stucki)
  • Is Regression set to No

No feedback for over 90 days.

Actions

Also available in: Atom PDF