[BUGFIX] Add name of missing file to Exception in thumbs.php
authorSteffen Gebert <steffen.gebert@typo3.org>
Sun, 24 Jul 2011 11:15:01 +0000 (13:15 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sun, 24 Jul 2011 16:41:16 +0000 (18:41 +0200)
Exception #1270853950 only gives a hint that
"Image does not exist and/or MD5 checksum did not match."

It is pretty hard to find out, which image is responsible for this,
without outputting the file name. Thus add the file name of the image.

Change-Id: Ie931f8c797020dad154c6694753e5ea448740ff2
Resolves: #24807
Reviewed-on: http://review.typo3.org/3699
Reviewed-by: Philipp Gampe
Reviewed-by: Mario Rimann
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/thumbs.php

index 3539c3c..a45a078 100644 (file)
@@ -139,6 +139,7 @@ class SC_t3lib_thumbs {
                        $file = PATH_site.substr($file,3);
                }
 
+               $mtime = 0;
                        // Now the path is absolute.
                        // Checking for backpath and double slashes + the thumbnail can be made from files which are in the PATH_site OR the lockRootPath only!
                if (t3lib_div::isAllowedAbsPath($file)) {
@@ -161,8 +162,10 @@ class SC_t3lib_thumbs {
                        $this->size = $size;
                        $this->mtime = $mtime;
                } else {
+                               // hide the path to the document root;
+                       $publicFilename = substr($file, strlen(PATH_site));
                        throw new RuntimeException(
-                               'TYPO3 Fatal Error: Image does not exist and/or MD5 checksum did not match.',
+                               'TYPO3 Fatal Error: Image \'' . $publicFilename . '\' does not exist and/or MD5 checksum did not match.',
                                1270853950
                        );
                }