Prechádzať zdrojové kódy

get_magic_quotes_* functions deprecated in PHP 5.3.x. Check for
existance and ignore deprecation warnings.

Thijs Kinkhorst 17 rokov pred
rodič
commit
8f8a7ea706
2 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  1. 1 1
      include/init.php
  2. 2 1
      src/configtest.php

+ 1 - 1
include/init.php

@@ -203,7 +203,7 @@ ini_set('magic_quotes_runtime','0');
 
 /* if running with magic_quotes_gpc then strip the slashes
    from POST and GET global arrays */
-if (get_magic_quotes_gpc()) {
+if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) {
     sqstripslashes($_GET);
     sqstripslashes($_POST);
 }

+ 2 - 1
src/configtest.php

@@ -303,7 +303,8 @@ if (function_exists('mb_internal_encoding') &&
 /**
  * Do not use SquirrelMail with magic_quotes_* on.
  */
-if ( get_magic_quotes_runtime() || get_magic_quotes_gpc() ||
+if ( (function_exists('get_magic_quotes_runtime') &&  @get_magic_quotes_runtime()) ||
+     (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) ||
     ( (bool) ini_get('magic_quotes_sybase') && ini_get('magic_quotes_sybase') != 'off' )
     ) {
     $magic_quotes_warning='You have enabled any one of <tt>magic_quotes_runtime</tt>, '