function do_magic_quotes_gpc(&$ar) {
    if (!is_array($ar)) return;

    while (list($key, $value) = each($ar)) {
      if (is_array($value)) {
        do_magic_quotes_gpc($value);
      } else {
        $ar[$key] = addslashes($value);
      }
    }
  }
Exemplo n.º 2
0
function do_magic_quotes_gpc(&$ar)
{
    if (!is_array($ar)) {
        return false;
    }
    while (list($key, $value) = each($ar)) {
        if (is_array($ar[$key])) {
            do_magic_quotes_gpc($ar[$key]);
        } else {
            $ar[$key] = addslashes($value);
        }
    }
    //060817 module patch by Bill Kellum of Sounds Good Productions
    reset($ar);
}
        } else {
            include DIR_WS_FUNCTIONS . 'gzip_compression.php';
            ob_start();
            ob_implicit_flush();
        }
    } else {
        ini_set('zlib.output_compression_level', GZIP_LEVEL);
    }
}
// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled
if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
    if (strlen(getenv('PATH_INFO')) > 1) {
        $GET_array = array();
        $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
        $vars = explode('/', substr(getenv('PATH_INFO'), 1));
        do_magic_quotes_gpc($vars);
        for ($i = 0, $n = sizeof($vars); $i < $n; $i++) {
            if (strpos($vars[$i], '[]')) {
                $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i + 1];
            } else {
                $HTTP_GET_VARS[$vars[$i]] = $vars[$i + 1];
            }
            $i++;
        }
        if (sizeof($GET_array) > 0) {
            while (list($key, $value) = each($GET_array)) {
                $HTTP_GET_VARS[$key] = $value;
            }
        }
    }
}