function zbx_stripslashes($value)
 {
     if (is_array($value)) {
         foreach ($value as $id => $data) {
             $value[$id] = zbx_stripslashes($data);
         }
     } elseif (is_string($value)) {
         $value = stripslashes($value);
     }
     return $value;
 }
Example #2
0
define('COPY_TYPE_TO_HOST', 0);
define('COPY_TYPE_TO_TEMPLATE', 2);
define('COPY_TYPE_TO_HOST_GROUP', 1);
define('HISTORY_GRAPH', 'showgraph');
define('HISTORY_BATCH_GRAPH', 'batchgraph');
define('HISTORY_VALUES', 'showvalues');
define('HISTORY_LATEST', 'showlatest');
// configuration -> maps default add icon name
define('MAP_DEFAULT_ICON', 'Server_(96)');
// server variables
define('HTTPS', isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] != 'off');
// if magic quotes on, then get rid of them
if (get_magic_quotes_gpc()) {
    function zbx_stripslashes($value)
    {
        $value = is_array($value) ? array_map('zbx_stripslashes', $value) : stripslashes($value);
        return $value;
    }
    $_GET = zbx_stripslashes($_GET);
    $_POST = zbx_stripslashes($_POST);
    $_COOKIE = zbx_stripslashes($_COOKIE);
}
// init $_REQUEST
ini_set('variables_order', 'GP');
$_REQUEST = $_POST + $_GET;
// init precision
ini_set('precision', 14);
// BC Math scale. bcscale() can be undefined prior requirement check in setup.
if (function_exists('bcscale')) {
    bcscale(7);
}
Example #3
0
function zbx_stripslashes($value)
{
    if (is_array($value)) {
        foreach ($value as $id => $data) {
            $value[$id] = zbx_stripslashes($data);
        }
        // $value = array_map('zbx_stripslashes',$value); /* don't use 'array_map' it buggy with indexes */
    } else {
        if (is_string($value)) {
            $value = stripslashes($value);
        }
    }
    return $value;
}