[TYPO3-core] RFC #12013: tslib_pagegen fails to read mime type of the shortcut icon

Xavier Perseguers typo3 at perseguers.ch
Fri Nov 6 19:54:31 CET 2009


Hi Rupert,

> I tried to reproduce this issue but failed to find a php version with 
> fileinfo.
> At least the php 5.3 from xammp doesn't provide it.
> 
> any hints how to test this?

You may easily to it by reading patch (and perhaps adding a few t3lib_div::debug() to see that patched code makes sense):

- See that the definition of finfo_file [1] expects a filename while first removed line in patch computed a URL instead
- See that the modified line stores in $favIcon only the relative path of the favorite icon (without the http://domain.tld part)
- Last change in patch that actually sets the favorite icon adds the http://domain.tld part I removed at the beginning, meaning those 2 modification behave exactly the same as before patch (=currently)

- Now regarding the call to finfo_file, I have a relative path instead of the URL, meaning I have something like

fileadmin/templates/myfavoriteicon.ico

instead of

http://domain.tld/fileadmin/templates/myfavoriteicon.ico

meaning that prepending PATH_site to $favIcon, I'll get a valid full path, something like:

/var/www/path/to/website/fileadmin/templates/myfavoriteicon.ico

which has no reason to break because it's a valid filename whereas current call cannot work.

In addition, if someone has finfo but only PHP 5.2, I'm pretty sure that trying to set the shortcutIcon from typoscript will lead to an empty type definition, something like

<link rel="shortcut icon" href="fileadmin/templates/myfavoriteicon.ico" type="" />

instead of

<link rel="shortcut icon" href="fileadmin/templates/myfavoriteicon.ico" type="image/x-icon" />

Meaning the bug is not seen in PHP 5.2 because it does not issue a warning and nobody had a close look to the generated HTML. I may be wrong here but I guess not.


[1] http://ch2.php.net/manual/de/function.finfo-file.php


-- 
Xavier Perseguers
http://xavier.perseguers.ch/en

One contribution a day keeps the fork away


More information about the TYPO3-team-core mailing list