mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-07 06:29:49 +01:00
Solved problem with magic_quotes_pgc and xajax request with depth greater 1
This commit is contained in:
parent
aa6f617322
commit
522b9884c3
@ -14,6 +14,25 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* applies stripslashes recursivly on each element of an array
|
||||||
|
*
|
||||||
|
* @param array &$var
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function array_stripslashes($var)
|
||||||
|
{
|
||||||
|
if (!is_array($var))
|
||||||
|
{
|
||||||
|
return stripslashes($var);
|
||||||
|
}
|
||||||
|
foreach($var as $key => $val)
|
||||||
|
{
|
||||||
|
$var[$key] = is_array($val) ? array_stripslashes($val) : stripslashes($val);
|
||||||
|
}
|
||||||
|
return $var;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the number of bytes of a string, independent of mbstring.func_overload
|
* Return the number of bytes of a string, independent of mbstring.func_overload
|
||||||
* AND the availability of mbstring
|
* AND the availability of mbstring
|
||||||
|
15
xajax.php
15
xajax.php
@ -83,17 +83,6 @@ function doXMLHTTP()
|
|||||||
$argList = func_get_args();
|
$argList = func_get_args();
|
||||||
$arg0 = array_shift($argList);
|
$arg0 = array_shift($argList);
|
||||||
|
|
||||||
if(get_magic_quotes_gpc()) {
|
|
||||||
foreach($argList as $key => $value) {
|
|
||||||
if(is_array($value)) {
|
|
||||||
foreach($argList as $key1 => $value1) {
|
|
||||||
$argList[$key][$key1] = stripslashes($value1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$argList[$key] = stripslashes($value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//error_log("xajax_doXMLHTTP('$arg0',...)".print_r($argList,true));
|
//error_log("xajax_doXMLHTTP('$arg0',...)".print_r($argList,true));
|
||||||
|
|
||||||
if (strpos($arg0,'::') !== false && strpos($arg0,'.') === false) // static method name app_something::method
|
if (strpos($arg0,'::') !== false && strpos($arg0,'.') === false) // static method name app_something::method
|
||||||
@ -119,6 +108,10 @@ function doXMLHTTP()
|
|||||||
);
|
);
|
||||||
include('./header.inc.php');
|
include('./header.inc.php');
|
||||||
|
|
||||||
|
if(get_magic_quotes_gpc()) {
|
||||||
|
$argList = array_stripslashes($argList);
|
||||||
|
}
|
||||||
|
|
||||||
// now the header is included, we can set the charset
|
// now the header is included, we can set the charset
|
||||||
$GLOBALS['xajax']->configure('characterEncoding',translation::charset());
|
$GLOBALS['xajax']->configure('characterEncoding',translation::charset());
|
||||||
define('XAJAX_DEFAULT_CHAR_ENCODING',translation::charset());
|
define('XAJAX_DEFAULT_CHAR_ENCODING',translation::charset());
|
||||||
|
Loading…
Reference in New Issue
Block a user