Bug #19406
closedFailed to load magic database
0%
Description
If the magic database cannot be loaded to know the mime type of the favicon, the next message appears when load every page of the site:
Warning: finfo_open() [function.finfo-open]: Failed to load magic database at '/etc/magic'. in /var/www/web/typo3_src-4.2.1/typo3/sysext/cms/tslib/class.tslib_pagegen.php on line 489
Warning: finfo_file(): supplied argument is not a valid file_info resource in /var/www/web/typo3_src-4.2.1/typo3/sysext/cms/tslib/class.tslib_pagegen.php on line 490
Warning: finfo_close(): supplied argument is not a valid file_info resource in /var/www/web/typo3_src-4.2.1/typo3/sysext/cms/tslib/class.tslib_pagegen.php on line 491
Warning: Cannot modify header information - headers already sent by (output started at /var/www/corporativa/typo3_src-4.2.1/typo3/sysext/cms/tslib/class.tslib_pagegen.php:489) in /var/www/corporativa/typo3_src-4.2.1/typo3/sysext/cms/tslib/class.tslib_fe.php on line 3221
This bug appeared after solving other: http://bugs.typo3.org/view.php?id=1537
The solution is modify after the line 489 of tslib/class.tslib_pagegen.php the next code:
$finfo = @finfo_open(FILEINFO_MIME);
$iconMimeType = ' type="'.finfo_file($finfo,$favIcon).'"';
finfo_close($finfo);
...and put this:
$finfo = @finfo_open(FILEINFO_MIME);
if ($finfo) {
$iconMimeType = ' type="'.finfo_file($finfo,$favIcon).'"';
finfo_close($finfo);
}
(issue imported from #M9469)
Files