Browse Source

Add warning about magic_quotes_* in configtest.

Thijs Kinkhorst 18 years ago
parent
commit
6dd622f14b
2 changed files with 16 additions and 0 deletions
  1. 1 0
      ChangeLog
  2. 15 0
      src/configtest.php

+ 1 - 0
ChangeLog

@@ -169,6 +169,7 @@ Version 1.5.2 - CVS
     and do_hook() now emulates do_hook_function()'s return value and 
     also has its plugin arguments passed by value, etc.
   - Drop obsolete ORDB RBL from filters plugin (#1629398).
+  - Add warning about magic_quotes_* in configtest.
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------

+ 15 - 0
src/configtest.php

@@ -216,6 +216,21 @@ if (function_exists('mb_internal_encoding') &&
     do_err($mb_error);
 }
 
+/**
+ * Do not use SquirrelMail with magic_quotes_* on.
+ */
+if ( get_magic_quotes_runtime() || 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>, '
+        .'<tt>magic_quotes_gpc</tt> or <tt>magic_quotes_sybase</tt> in your PHP '
+        .'configuration. We recommend all those settings to be off. SquirrelMail '
+        .'may work with them on, but when experiencing stray backslashes in your mail '
+        .'or other strange behaviour, it may be advisable to turn them off.';
+    do_err($magic_quotes_warning,false);
+}
+
+
 /* checking paths */
 
 echo "Checking paths...<br />\n";