Changeset 2873

Show
Ignore:
Timestamp:
11/24/08 20:58:06 (6 weeks ago)
Author:
rickc
Message:

Fixes for the installhandler to cope with the changes wrought by SuperGlobal. All props to scoates for the patches.

Location:
trunk/htdocs/system/classes
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/system/classes/actionhandler.php

    r2851 r2873  
    2020     * Internal array of handler variables (state info) 
    2121     * 
    22      * @var array 
     22     * @var SuperGlobal 
    2323     */ 
    24     public $handler_vars = array(); 
     24    public $handler_vars = null; 
    2525 
    2626    /** 
     
    3333     */ 
    3434    public function act($action) { 
     35        if (null === $this->handler_vars) { 
     36            $this->handler_vars = new SuperGlobal(array()); 
     37        } 
    3538        $this->action = $action; 
    3639 
  • trunk/htdocs/system/classes/installhandler.php

    r2851 r2873  
    702702            return false; 
    703703        } 
    704         $vars = array_map('addslashes', $this->handler_vars); 
     704 
     705        $vars = array(); 
     706        foreach ($this->handler_vars as $k => $v) { 
     707            $vars[$k] = addslashes($v); 
     708        } 
     709        $keys = array(); 
     710        foreach (array_keys($vars) as $v) { 
     711            $keys[] = Utils::map_array($v); 
     712        } 
     713 
    705714        $file_contents = str_replace( 
    706             array_map(array('Utils', 'map_array'), array_keys($vars)), 
     715            $keys, 
    707716            $vars, 
    708717            $file_contents