Index: branches/5.1.x/core/kernel/utility/http_query.php =================================================================== diff -u -N -r12657 -r13086 --- branches/5.1.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 12657) +++ branches/5.1.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 13086) @@ -1,6 +1,6 @@ Conn =& $this->Application->GetADODBConnection(); + $this->Conn =& $this->Application->GetADODBConnection(); $this->Order = $order; - $this->Admin = $this->Application->IsAdmin(); // better cache this value, not to calculate it each time in foreach if (array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { // when AJAX request is made from jQuery, then create ajax variable, @@ -371,6 +370,11 @@ // get joined version (env var + mod rewrite parsed) $passed = $this->Application->GetVar('passed'); + + if (!array_key_exists('editing_mode', $module_params)) { + $module_params['editing_mode'] = ''; + } + $env = $this->Application->BuildEnv( $this->Get('t'), $module_params, $passed, false, false ); $this->Set(ENV_VAR_NAME, $env); $_REQUEST['env'] = $_GET['env'] = $env; // for capability with old in-portal code @@ -546,23 +550,29 @@ function StripSlashes($array) { - //if( !get_magic_quotes_gpc() ) return $array; - foreach($array as $key=>$value) - { - if( is_array($value) ) - { + static $magic_quotes = null; + + if (!isset($magic_quotes)) { + $magic_quotes = get_magic_quotes_gpc(); + } + + foreach ($array as $key => $value) { + if (is_array($value)) { $array[$key] = $this->StripSlashes($value); } - else - { -// $value = iconv('UTF-8', 'windows-1257', $value); + else { + if ($magic_quotes) { + $value = stripslashes($value); + } - if( get_magic_quotes_gpc() ) $value = stripslashes($value); - if(!$this->Admin) $value = htmlspecialchars($value); + if (!$this->Application->isAdmin) { + $value = htmlspecialchars($value); + } + $array[$key] = $value; } - //$array[$key]=is_array($value)?$this->StripSlashes($value):stripslashes($value); } + return $array; } @@ -589,14 +599,8 @@ } if ($access_error) { + // place 1 of 2 (also in UsersEventHandler::OnSessionExpire) $vars = $this->_removePassThroughVariables($vars); - - if ($this->Application->IsAdmin()) { - // place 1 of 2 (also in UsersEventHandler::OnSessionExpire) - $vars['m_cat_id'] = 0; // category means nothing on admin login screen - $vars['m_wid'] = ''; // remove wid, otherwise parent window may add wid to its name breaking all the frameset (for targets) - $vars['pass'] = 'm'; // don't pass any other (except "m") prefixes to admin login template - } } // transform arrays @@ -651,7 +655,7 @@ if ($fp) { $session =& $this->Application->recallObject('Session'); $user_id = $session->GetField('PortalUserId'); - $admin_mark = $this->Application->IsAdmin() ? 'ADMIN' : 'FRONT'; + $admin_mark = $this->Application->isAdmin ? 'ADMIN' : 'FRONT'; $data = '['.date('D M d H:i:s Y').'] '.$admin_mark.'; ip: '.$_SERVER['REMOTE_ADDR'].'; user_id: '.$user_id.'; sid: '.$this->Application->GetSID().'; request: '."\n"; if ($this->Get) {