Browse Source

fix php deprecated warnings

SiM 6 years ago
parent
commit
2f39434f8d

+ 4 - 2
lib/symfony/lib/cache/sfFileCache.class.php

@@ -216,7 +216,8 @@ class sfFileCache extends sfCache
     clearstatcache(); // because the filesize can be cached by PHP itself...
     $length = @filesize($path);
     $mqr = get_magic_quotes_runtime();
-    set_magic_quotes_runtime(0);
+    //set_magic_quotes_runtime(0); DEPRECATED
+    ini_set("magic_quotes_runtime", 0);
     switch ($type)
     {
       case self::READ_TIMEOUT:
@@ -240,7 +241,8 @@ class sfFileCache extends sfCache
       default:
         throw new sfConfigurationException(sprintf('Unknown type "%s".', $type));
     }
-    set_magic_quotes_runtime($mqr);
+    //set_magic_quotes_runtime($mqr); DEPRECATED
+    ini_set("magic_quotes_runtime", 0);
     @flock($fp, LOCK_UN);
     @fclose($fp);
 

+ 1 - 1
lib/symfony/lib/config/sfApplicationConfiguration.class.php

@@ -152,7 +152,7 @@ abstract class sfApplicationConfiguration extends ProjectConfiguration
     // compress output
     if (!self::$coreLoaded)
     {
-      ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : '');
+      ob_start(sfConfig::get('sf_compressed') ? 'ob_gzhandler' : null);
     }
 
     self::$coreLoaded = true;

+ 8 - 1
lib/symfony/lib/response/sfWebResponse.class.php

@@ -371,7 +371,14 @@ class sfWebResponse extends sfResponse
    */
   protected function normalizeHeaderName($name)
   {
-    return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", strtr(ucfirst(strtolower($name)), '_', '-'));
+    //return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", strtr(ucfirst(strtolower($name)), '_', '-'));
+    return preg_replace_callback(
+                  '/\-(.)/', 
+                  function ($matches) {
+                    return '-'.strtoupper($matches[1]);
+                  }, 
+                  strtr(ucfirst(strtolower($name)), '_', '-')
+        );
   }
 
   /**

+ 2 - 1
plugins/sfThumbnailPlugin/lib/sfThumbnail.class.php

@@ -71,7 +71,8 @@ class sfThumbnail
    */
   public function loadFile($image)
   {
-    if (eregi('http(s)?://', $image))
+    //if (eregi('http(s)?://', $image))
+    if (preg_match('http(s)?://', $image))
     {
       if (class_exists('sfWebBrowser'))
       {