Project

General

Profile

Actions

Bug #19406

closed

Failed to load magic database

Added by Antonio Alvarez about 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2008-10-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

9469.diff (798 Bytes) 9469.diff Administrator Admin, 2008-10-03 10:28
Actions #1

Updated by Dmitry Dulepov about 16 years ago

4.2.3: rev 4305
4.3-alpha1: rev 4304

Actions

Also available in: Atom PDF