Fixed bug #9773: Fallback for skinImg having forceFileExtension
authorSteffen Kamper <info@sk-typo3.de>
Mon, 29 Dec 2008 13:32:28 +0000 (13:32 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 29 Dec 2008 13:32:28 +0000 (13:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@4622 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_iconworks.php

index b82c13e..9fe4f74 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-12-28  Steffen Kamper  <info@sk-typo3.de> 
+
+       * Fixed bug #9773: Fallback for skinImg having forceFileExtension
+
 2008-12-25  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #10012: TYPO3 generates incorrect ETag
index 428644d..c40455e 100755 (executable)
@@ -289,7 +289,11 @@ final class t3lib_iconWorks        {
                        $fExt = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['forceFileExtension'];
                        $scaleFactor = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] : 1;   // Scaling factor
                        $lookUpName = $fExt ? ereg_replace('\.[[:alnum:]]+$', '', $srcKey).'.'.$fExt : $srcKey; // Set filename to look for
-
+        
+                       if ($fExt && !@is_file($GLOBALS['TBE_STYLES']['skinImgAutoCfg']['absDir'] . $lookUpName)) {
+                               // fallback to original filename if icon with forced extension doesn't exists
+                               $lookUpName = $srcKey;  
+                       }
                                // If file is found:
                        if (@is_file($GLOBALS['TBE_STYLES']['skinImgAutoCfg']['absDir'].$lookUpName))   {       // If there is a file...
                                $iInfo = @getimagesize($GLOBALS['TBE_STYLES']['skinImgAutoCfg']['absDir'].$lookUpName); // Get width/height:
@@ -522,4 +526,4 @@ final class t3lib_iconWorks {
                }
        }
 }
-?>
\ No newline at end of file
+?>