Changeset d349d6f in git


Ignore:
Timestamp:
2009-07-05T06:03:56Z (10 years ago)
Author:
Xuefer <xuefer@…>
Branches:
1.3
Children:
b13a1fe
Parents:
8a8b80b
Message:

merged 418,r419,r424,r425,r429,r431 from trunk

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.3@607 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin/common.php

    rce81573 rd349d6f  
    7575}
    7676
     77function stripaddslashes_array($value, $mqs = false)
     78{
     79    if (is_array($value)) {
     80        foreach($value as $k => $v) {
     81            $value[$k] = stripaddslashes_array($v, $mqs);
     82        }
     83    }
     84    else if(is_string($value)) {
     85        $value = $mqs ? str_replace('\'\'', '\'', $value) : stripslashes($value);
     86    }
     87    return $value;
     88}
     89
    7790error_reporting(E_ALL);
    7891ini_set('display_errors', 'On');
    7992define('REQUEST_TIME', time());
     93
     94if (get_magic_quotes_gpc()) {
     95    $mqs = (bool) ini_get('magic_quotes_sybase');
     96    $_GET = stripaddslashes_array($_GET, $mqs);
     97    $_POST = stripaddslashes_array($_POST, $mqs);
     98    $_REQUEST = stripaddslashes_array($_REQUEST, $mqs);
     99}
     100ini_set('magic_quotes_runtime', '0');
    80101
    81102$charset = "UTF-8";
  • admin/edit.php

    r0339491 rd349d6f  
    1212
    1313if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    14     xcache_set($name, $_POST['value']);
     14    eval('$value = ' . $_POST['value']);
     15    xcache_set($name, $value);
    1516    header("Location: xcache.php?type=" . XC_TYPE_VAR);
    1617    exit;
    1718}
    18 $value = xcache_get($name);
     19$value = var_export(xcache_get($name), true);
    1920
    2021$xcache_version = XCACHE_VERSION;
  • coverager/common.php

    rce81573 rd349d6f  
    7575}
    7676
     77function stripaddslashes_array($value, $mqs = false)
     78{
     79    if (is_array($value)) {
     80        foreach($value as $k => $v) {
     81            $value[$k] = stripaddslashes_array($v, $mqs);
     82        }
     83    }
     84    else if(is_string($value)) {
     85        $value = $mqs ? str_replace('\'\'', '\'', $value) : stripslashes($value);
     86    }
     87    return $value;
     88}
     89
    7790error_reporting(E_ALL);
    7891ini_set('display_errors', 'On');
    7992define('REQUEST_TIME', time());
     93
     94if (get_magic_quotes_gpc()) {
     95    $mqs = (bool) ini_get('magic_quotes_sybase');
     96    $_GET = stripaddslashes_array($_GET, $mqs);
     97    $_POST = stripaddslashes_array($_POST, $mqs);
     98    $_REQUEST = stripaddslashes_array($_REQUEST, $mqs);
     99}
     100ini_set('magic_quotes_runtime', '0');
    80101
    81102$charset = "UTF-8";
Note: See TracChangeset for help on using the changeset viewer.