[TASK] Mimetype-detection without finfo_file 14/18814/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 8 Mar 2013 11:10:34 +0000 (12:10 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 13 Mar 2013 18:55:05 +0000 (19:55 +0100)
Function finfo_file() is only available in PHP 5.3+
or with pecl-ext fileinfo. Fall back to using
mime_content_type() instead, if necessary.

Resolves: #46126
Releases: 4.5
Change-Id: I2d0fc91396019f546467d6f9fd5718d6646614e4
Reviewed-on: https://review.typo3.org/18814
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/tslib/class.tslib_pagegen.php

index 6478332..88397a4 100644 (file)
@@ -504,9 +504,11 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                                if (($finfo = @finfo_open(FILEINFO_MIME))) {
                                        $iconMimeType = ' type="' . finfo_file($finfo, PATH_site . $favIcon) . '"';
                                        finfo_close($finfo);
-                                       $pageRenderer->setIconMimeType($iconMimeType);
                                }
+                       } else {
+                               $iconMimeType = ' type="' . mime_content_type(PATH_site . $favIcon) . '"';
                        }
+                       $pageRenderer->setIconMimeType($iconMimeType);
                        $pageRenderer->setFavIcon(t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $favIcon);
 
                }