Changeset 2794

Show
Ignore:
Timestamp:
11/11/08 22:10:39 (2 months ago)
Author:
sean
Message:

cleanup (PHP 5-itize), and make process_gpc() single-run.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/sginput/htdocs/system/classes/superglobal.php

    r2792 r2794  
    1010    protected $values = array(); 
    1111 
    12     function SuperGlobal($array) 
     12    function __construct(array $array) 
    1313    { 
    1414        $values['default'] = array(); 
     
    2525        /* We should only revert the magic quotes once per page hit */ 
    2626        static $revert = true; 
    27         if ( get_magic_quotes_gpc() && $revert) { 
     27         
     28        if (!$revert) { 
     29            // our work has already been done 
     30            return; 
     31        } 
     32         
     33        if ( get_magic_quotes_gpc() ) { 
    2834            $_GET = Utils::stripslashes($_GET); 
    2935            $_POST = Utils::stripslashes($_POST); 
    3036            $_COOKIE = Utils::stripslashes($_COOKIE); 
    31             $revert = false; 
    3237        } 
    3338 
     
    3641        $_COOKIE = new SuperGlobal($_COOKIE); 
    3742        unset($_REQUEST); 
     43 
     44        $revert = false; 
    3845    } 
    3946 
    40     function offsetGet($index) 
     47    public function offsetGet($index) 
    4148    { 
    4249        $cp = $this->getArrayCopy(); 
     
    6067     * @return SuperGlobal The merged array 
    6168     */ 
    62     function merge() 
     69    public function merge() 
    6370    { 
    6471        $args = func_get_args(); 
     
    99106     * @return SuperGlobal The values from this array that match the supplied keys 
    100107     */ 
    101     function filter_keys() 
     108    public function filter_keys() 
    102109    { 
    103110        $keys = array();