[BUGFIX] Call to undefined function mime_content_type() 57/20557/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 6 May 2013 19:24:06 +0000 (21:24 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 6 May 2013 20:10:03 +0000 (22:10 +0200)
With PHP 5.2, it might happen that mime_content_type is not
available. This was introduced by #46126 and is now better
sanitized by the patch again.

Change-Id: I4145461d46fc12d0569bfffc0ad4750f67aeed2c
Resolves: #47969
Related: #46126
Releases: 4.5
Reviewed-on: https://review.typo3.org/20557
Reviewed-by: Steffen Ritter
Reviewed-by: Jigal van Hemert
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/tslib/class.tslib_pagegen.php

index e2b39d5..edfea36 100644 (file)
@@ -504,11 +504,12 @@ 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 {
+                       } elseif (function_exists('mime_content_type')) {
                                $iconMimeType = ' type="' . mime_content_type(PATH_site . $favIcon) . '"';
+                               $pageRenderer->setIconMimeType($iconMimeType);
                        }
-                       $pageRenderer->setIconMimeType($iconMimeType);
                        $pageRenderer->setFavIcon(t3lib_div::getIndpEnv('TYPO3_SITE_URL') . $favIcon);
 
                }
@@ -1210,4 +1211,4 @@ class FE_loadDBGroup extends t3lib_loadDBGroup {
        var $fromTC = 0;        // Means that everything is returned instead of only uid and label-field
 }
 
-?>
+?>
\ No newline at end of file