Index: kernel/managers/plain_url_processor.php =================================================================== --- kernel/managers/plain_url_processor.php (revision 15359) +++ kernel/managers/plain_url_processor.php (working copy) @@ -157,11 +157,8 @@ } } - $session = $this->Application->recallObject('Session'); - /* @var $session Session */ - $ssl = isset($params['__SSL__']) ? $params['__SSL__'] : 0; - $sid = $session->NeedQueryString() && !$this->Application->RewriteURLs($ssl) ? $this->Application->GetSID() : ''; + $sid = isset($params['sid']) && !$this->Application->RewriteURLs($ssl) ? $params['sid'] : ''; $ret = ''; if ( $env_var ) { Index: kernel/managers/url_manager.php =================================================================== --- kernel/managers/url_manager.php (revision 15362) +++ kernel/managers/url_manager.php (working copy) @@ -207,17 +207,17 @@ // append pass through variables to each link to be build $params = array_merge($this->getPassThroughVariables($params), $params); + $session = $this->Application->recallObject('Session'); + + if ( $session->NeedQueryString() && !$force_no_sid ) { + $params['sid'] = $this->Application->GetSID(); + } + if ( $force_rewrite || ($this->Application->RewriteURLs($ssl) && $rewrite) ) { if ( !$this->rewriteReady ) { $this->initRewrite(); } - $session = $this->Application->recallObject('Session'); - - if ( $session->NeedQueryString() && !$force_no_sid ) { - $params['sid'] = $this->Application->GetSID(); - } - $url = $this->rewrite->build($t, $params, $pass, $pass_events); } else { Index: units/categories/categories_tag_processor.php =================================================================== --- units/categories/categories_tag_processor.php (revision 15360) +++ units/categories/categories_tag_processor.php (working copy) @@ -174,7 +174,11 @@ if ($this->Application->GetVar('m_cat_id') == $module_root_cat || in_array($this->Application->GetVar('m_cat_id'), $additional_cats)) { $home_template = getArrayValue($params, 'home_template'); - if (!$home_template) return; + + if ( !$home_template ) { + return; + } + $this->Application->Redirect($home_template, Array('pass'=>'all')); }; } @@ -614,7 +618,9 @@ $clipboard = unserialize($clipboard); foreach ($clipboard as $prefix => $clipboard_data) { foreach ($clipboard_data as $mode => $ids) { - if (count($ids)) return 1; + if ( count($ids) ) { + return 1; + } } } } @@ -667,7 +673,10 @@ function InitCatalog($params) { $tab_prefixes = $this->Application->GetVar('tp'); // {all, , none} - if ($tab_prefixes === false) $tab_prefixes = 'all'; + if ( $tab_prefixes === false ) { + $tab_prefixes = 'all'; + } + $skip_prefixes = isset($params['skip_prefixes']) && $params['skip_prefixes'] ? explode(',', $params['skip_prefixes']) : Array(); $replace_main = isset($params['replace_m']) && $params['replace_m']; @@ -676,7 +685,9 @@ foreach ($this->Application->ModuleInfo as $module_name => $module_data) { $prefix = $module_data['Var']; - if ($prefix == 'adm'/* || $prefix == 'm'*/) continue; + if ( $prefix == 'adm' /* || $prefix == 'm'*/ ) { + continue; + } if ($prefix == 'm' && $replace_main) { $prefix = 'c'; @@ -1020,10 +1031,18 @@ $tab_params['dependant'] = $this->Application->GetVar('td'); // is grid dependant on categories grid // set default params (same as in catalog) - if ($tab_params['mode'] === false) $tab_params['mode'] = 'multi'; - if ($tab_params['special'] === false) $tab_params['special'] = ''; - if ($tab_params['dependant'] === false) $tab_params['dependant'] = 'yes'; + if ( $tab_params['mode'] === false ) { + $tab_params['mode'] = 'multi'; + } + if ( $tab_params['special'] === false ) { + $tab_params['special'] = ''; + } + + if ( $tab_params['dependant'] === false ) { + $tab_params['dependant'] = 'yes'; + } + // pass params to block with tab content $params['name'] = $params['render_as']; $special = $tab_params['special'] ? $tab_params['special'] : $this->Special; @@ -1825,7 +1844,14 @@ return $this->Application->HREF($object->GetDBField('NamedParentPath'), '_FRONT_END_', $url_params); } - function DirectLink($params) + /** + * Builds a link for securely accessing a page later (even if it will not be publicly accessible) + * + * @param Array $params + * @return string + * @access protected + */ + protected function DirectLink($params) { $object = $this->getObject($params); /* @var $object kDBItem */ @@ -1837,13 +1863,17 @@ 'm_cat_id' => $object->GetID(), 'm_theme' => $themes_helper->getCurrentThemeId(), 'pass' => 'm', - 'index_file' => 'index.php', 'authkey' => $object->GetDBField('DirectLinkAuthKey'), + '__SSL__' => 0, + '__NO_SID__' => 0, ); if ($this->Application->ConfigValue('UseModRewrite')) { $url_params['__MOD_REWRITE__'] = 1; } + else { + $url_params['index_file'] = 'index.php'; + } return $this->Application->HREF($object->GetDBField('NamedParentPath'), '_FRONT_END_', $url_params); }