Fixed bug #12017: Wrong Inclusion in tceforms and tceforms_fe
[Packages/TYPO3.CMS.git] / t3lib / thumbs.php
old mode 100755 (executable)
new mode 100644 (file)
index 8278dd1..e902e54
@@ -65,7 +65,7 @@ error_reporting (E_ALL ^ E_NOTICE);
 define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
 define('TYPO3_MODE','BE');
 if(!defined('PATH_thisScript')) define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
-if(!defined('PATH_site'))              define('PATH_site', ereg_replace('[^/]*.[^/]*$','',PATH_thisScript));           // the path to the website folder (see init.php)
+if(!defined('PATH_site'))              define('PATH_site', preg_replace('/[^\/]*.[^\/]*$/','',PATH_thisScript));               // the path to the website folder (see init.php)
 if(!defined('PATH_t3lib'))             define('PATH_t3lib', PATH_site.'t3lib/');
 define('PATH_typo3conf', PATH_site.'typo3conf/');
 define('TYPO3_mainDir', 'typo3/');             // This is the directory of the backend administration for the sites of this TYPO3 installation.
@@ -188,7 +188,7 @@ class SC_t3lib_thumbs {
 
                                // Check file extension:
                        $reg = array();
-                       if (ereg('(.*)\.([^\.]*$)',$this->input,$reg))  {
+                       if (preg_match('/(.*)\.([^\.]*$)/',$this->input,$reg))  {
                                $ext=strtolower($reg[2]);
                                $ext=($ext=='jpeg')?'jpg':$ext;
                                if ($ext=='ttf')        {