Follow-up to bugfix #12090: Applied fix to thumbnail view as well
authorOliver Hader <oliver.hader@typo3.org>
Thu, 22 Oct 2009 11:55:26 +0000 (11:55 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 22 Oct 2009 11:55:26 +0000 (11:55 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6262 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/thumbs.php

index e902e54..500c121 100644 (file)
@@ -372,17 +372,14 @@ class SC_t3lib_thumbs {
        }
 
        /**
-        * Wrapping the input filename in double-quotes
+        * Escapes a file name so it can safely be used on the command line.
         *
-        * @param       string          Input filename
-        * @return      string          The output wrapped in "" (if there are spaces in the filepath)
-        * @access private
+        * @param string $inputName filename to safeguard, must not be empty
+        *
+        * @return string $inputName escaped as needed
         */
-       function wrapFileName($inputName)       {
-               if (strstr($inputName,' '))     {
-                       $inputName='"'.$inputName.'"';
-               }
-               return $inputName;
+       protected function wrapFileName($inputName) {
+               return escapeshellarg($inputName);
        }
 }