Index: branches/5.2.x/core/kernel/session/session.php =================================================================== diff -u -N -r14699 -r14714 --- branches/5.2.x/core/kernel/session/session.php (.../session.php) (revision 14699) +++ branches/5.2.x/core/kernel/session/session.php (.../session.php) (revision 14714) @@ -1,6 +1,6 @@ Get, $this->GETName); - if ( ($this->IsHTTPSRedirect() && $get_sid) || $this->getFlashSID() ) { // Redirect from http to https on different domain OR flash uploader + if ( ($this->Application->HttpQuery->IsHTTPSRedirect() && $get_sid) || $this->getFlashSID() ) { // Redirect from http to https on different domain OR flash uploader $this->OriginalMode = $this->Mode; $this->SetMode(self::smGET_ONLY); } - if ( !$cookies_on || $this->IsHTTPSRedirect() || $this->getFlashSID() ) { + if ( !$cookies_on || $this->Application->HttpQuery->IsHTTPSRedirect() || $this->getFlashSID() ) { //If referer is our server, but we don't have our cookies_on, it's definetly off $is_install = defined('IS_INSTALL') && IS_INSTALL; - if ( !$is_install && $this->_checkCookieReferer() && !$this->Application->GetVar('admin') && !$this->IsHTTPSRedirect() ) { + if ( !$is_install && $this->_checkCookieReferer() && !$this->Application->GetVar('admin') && !$this->Application->HttpQuery->IsHTTPSRedirect() ) { $this->CookiesEnabled = false; } else { @@ -590,18 +574,19 @@ function SetSession($force = false) { - if ($this->SessionSet && !$force) { + if ( $this->SessionSet && !$force ) { return true; } $this->Expiration = adodb_mktime() + $this->SessionTimeout; - if (!$force && /*!$this->Application->isAdmin &&*/ !$this->Application->GetVar('admin') && !$this->NeedSession()) { + if ( !$force && /*!$this->Application->isAdmin &&*/ !$this->Application->GetVar('admin') && !$this->NeedSession() ) { // don't create session (in db) on Front-End, when sid is present (GPC), but data in db isn't - if ($this->_fromGet) { + if ( $this->_fromGet ) { // set sid, that was given in GET - $this->setSID( $this->GetPassedSIDValue() ); - } else { + $this->setSID($this->GetPassedSIDValue()); + } + else { // re-generate sid only, when cookies are used $this->GenerateSID(); } @@ -611,13 +596,13 @@ return false; } - if (!$this->SID || $force) { + if ( !$this->SID || $force ) { $this->GenerateSID(); } - switch ($this->Mode) { + switch ( $this->Mode ) { case self::smAUTO: - if ($this->CookiesEnabled) { + if ( $this->CookiesEnabled ) { $this->SetSessionCookie(); } break; @@ -633,12 +618,12 @@ $this->Storage->StoreSession(); - if ($this->Application->isAdmin || $this->Special == 'admin') { + if ( $this->Application->isAdmin || $this->Special == 'admin' ) { $this->StoreVar('admin', 1); } $this->SessionSet = true; // should be called before SaveData, because SaveData will try to SetSession again - if ($this->Special != '') { + if ( $this->Special != '' ) { // front-session called from admin or otherwise, then save it's data $this->SaveData(); } @@ -828,15 +813,15 @@ { $wid = $this->Application->GetVar('m_wid'); - $last_env = $this->getLastTemplateENV($t, Array('m_opener' => 'u')); - $last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1); - $this->StoreVar(rtrim('last_template_'.$wid, '_'), $last_template); + $last_env = $this->getLastTemplateENV($t, Array ('m_opener' => 'u')); + $last_template = basename($_SERVER['PHP_SELF']) . '|' . $last_env; + $this->StoreVar(rtrim('last_template_' . $wid, '_'), $last_template); // prepare last_template for opener stack, module & session could be added later $last_env = $this->getLastTemplateENV($t, null, false); - $last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1); + $last_template = basename($_SERVER['PHP_SELF']) . '|' . $last_env; - // save last_template in persistant session + // save last_template in persistent session if (!$wid) { if ($this->Application->isAdmin) { // only for main window, not popups, not login template, not temp mode (used in adm:MainFrameLink tag) @@ -850,8 +835,8 @@ } if (!$temp_mode) { - if (isset($this->Application->HttpQuery->Get['section'])) { - // check directly in GET, bacause LinkVar (session -> request) used on these vars + if ( $this->Application->GetVarDirect('section', 'Get') !== false ) { + // check directly in GET, because LinkVar (session -> request) used on these vars $last_template .= '§ion='.$this->Application->GetVar('section').'&module='.$this->Application->GetVar('module'); } @@ -885,14 +870,14 @@ } } - // save other last... variables for mistical purposes (customizations may be) + // save other last... variables for mystical purposes (customizations may be) $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink - $this->StoreVar('last_env', mb_substr($last_env, mb_strlen(ENV_VAR_NAME)+1)); + $this->StoreVar('last_env', $last_env); $save_last_template = array_key_exists('save_last_template', $params) ? $params['save_last_template'] : true; if ($save_last_template) { - // save last template here, becase section & module could be added before + // save last template here, because section & module could be added before $this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template); } } @@ -911,7 +896,7 @@ } $params = array_merge($this->Application->getPassThroughVariables($params), $params); - $ret = $this->Application->BuildEnv($t, $params, 'all'); + $ret = $this->Application->BuildEnv($t, $params, 'all', false, false); if (!$encode) { // cancels 2nd part of replacements, that URLENCODE does