Update of /cvsroot/phpwiki/phpwiki/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6138
Modified Files:
prepend.php
Log Message:
guard against php5 register-long-arrays
Index: prepend.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/prepend.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -2 -b -p -d -r1.34 -r1.35
--- prepend.php 27 Feb 2005 13:18:47 -0000 1.34
+++ prepend.php 11 Apr 2005 19:44:22 -0000 1.35
@@ -21,4 +21,15 @@ function check_php_version ($a = '0', $b
}
+/** PHP5 deprecated old-style globals if !ini_get('register-long-arrays').
+ * See Bug #1180115
+ * We want to work with those old ones instead of the new superglobals,
+ * for easier coding.
+ */
+foreach (array('SERVER','REQUEST','GET','POST','SESSION','ENV','COOKIE') as $k) {
+ if (!isset($GLOBALS['HTTP_'.$k.'_VARS']) and isset($GLOBALS['_'.$k]))
+ $GLOBALS['HTTP_'.$k.'_VARS'] =& $GLOBALS['_'.$k];
+}
+unset($k);
+
// If your php was compiled with --enable-trans-sid it tries to
// add a PHPSESSID query argument to all URL strings when cookie
|