Changeset 2799
- Timestamp:
- 11/12/08 00:55:30 (2 months ago)
- Location:
- branches/sginput/htdocs/system/classes
- Files:
-
- 3 modified
-
actionhandler.php (modified) (2 diffs)
-
installhandler.php (modified) (5 diffs)
-
string.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/sginput/htdocs/system/classes/actionhandler.php
r2606 r2799 20 20 * Internal array of handler variables (state info) 21 21 * 22 * @var array22 * @var SuperGlobal 23 23 */ 24 public $handler_vars = array(); 24 public $handler_vars; 25 26 /** 27 * Constructor 28 * 29 * Initializes handler_vars 30 */ 31 public function __construct() { 32 $this->handler_vars = new SuperGlobal(array()); 33 } 25 34 26 35 /** … … 76 85 */ 77 86 public function __call($function, $args) { 78 $this->handler_vars = array_merge($this->handler_vars,$args);87 $this->handler_vars = $this->handler_vars->merge($args); 79 88 return $this->act($function); 80 89 } -
branches/sginput/htdocs/system/classes/installhandler.php
r2745 r2799 14 14 public function act_begin_install() 15 15 { 16 // Revert magic quotes, normally Controller calls this.17 Utils::revert_magic_quotes_gpc();18 19 16 // Create a new theme to handle the display of the installer 20 17 $this->theme = Themes::create('installer', 'RawPHPEngine', HABARI_PATH . '/system/installer/'); … … 119 116 // now merge in any HTTP POST values that might have been sent 120 117 // these will override the defaults and the config.php values 121 $this->handler_vars = array_merge($this->handler_vars,$_POST);118 $this->handler_vars = $this->handler_vars->merge($_POST); 122 119 123 120 // we need details for the admin user to install … … 142 139 143 140 // make sure the admin password is correct 144 if ( $this->handler_vars['admin_pass1'] !==$this->handler_vars['admin_pass2'] ) {141 if ( (string)$this->handler_vars['admin_pass1'] !== (string)$this->handler_vars['admin_pass2'] ) { 145 142 $this->theme->assign( 'form_errors', array('password_mismatch'=>_t('Password mis-match.')) ); 146 143 $this->display('db_setup'); … … 518 515 $admin_pass = $this->handler_vars['admin_pass1']; 519 516 520 if ($admin_pass {0}== '{') {517 if ($admin_pass[0] == '{') { 521 518 // looks like we might have a crypted password 522 519 $password = $admin_pass; … … 677 674 return false; 678 675 } 679 $vars = array_map('addslashes', $this->handler_vars); 676 677 $vars = array(); 678 foreach ($this->handler_vars as $k => $v) { 679 $vars[$k] = addslashes($v); 680 } 681 $keys = array(); 682 foreach (array_keys($vars) as $v) { 683 $keys[] = Utils::map_array($v); 684 } 680 685 $file_contents = str_replace( 681 array_map(array('Utils', 'map_array'), array_keys($vars)),686 $keys, 682 687 $vars, 683 688 $file_contents -
branches/sginput/htdocs/system/classes/string.php
r2790 r2799 8 8 */ 9 9 10 class String 10 class String implements ArrayAccess 11 11 { 12 12 protected $string; … … 91 91 return new String(call_user_func_array(array('Plugins', $filter), $args)); 92 92 } 93 94 // ArrayAccess Implementation for (e.g.) $string[0] 95 96 public function offsetExists($offset) { 97 return $offset >= 0 && $offset < strlen($this->string); 98 } 99 public function offsetGet($offset) { 100 return $this->string[$offset]; 101 } 102 public function offsetSet($offset, $value) { 103 $this->string[$offset] = $value[0]; 104 } 105 public function offsetUnset ($offset) { 106 throw new Exception('Cannot unset String offsets'); 107 } 93 108 } 94 109
