MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / wiki / ewiki / fragments / strip_wonderful_slashes.php
blob261134848e319a32905414effb034d22301a7241
1 <?php
3 /*
5 this strips all "\" from $_REQUEST and
6 disables the runtime garbaging as well
8 just include() it before ewiki.php
9 and everythink should work fine
12 for Apache+mod_php you should however rather use the
13 [.htaccess] PHP reconfiguration trick:
14 php_flag magic_quotes_gpc off
15 php_flag magic_quotes_runtime off
20 #-- this is very evil too
21 set_magic_quotes_runtime(0);
23 #-- Moodle always addslashes to everything so
24 #-- we strip them back again here to allow
25 #-- the wiki module itself to add them before
26 #-- insert. Strange triple add-strip-add but
27 #-- this was the best way to solve problems
28 #-- without changing how the rest of the
29 #-- module works.
31 $superglobals = array(
32 "_REQUEST",
33 "_GET",
34 "_POST",
35 "_COOKIE",
36 "_ENV",
37 "_SERVER"
40 foreach ($superglobals as $AREA) {
42 foreach ($GLOBALS[$AREA] as $name => $value) {
44 if (!is_array($value)) {
45 $GLOBALS[$AREA][$name] = stripslashes($value);