Index: branches/5.2.x/core/kernel/utility/http_query.php =================================================================== diff -u -N -r14628 -r14663 --- branches/5.2.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 14628) +++ branches/5.2.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 14663) @@ -1,6 +1,6 @@ $event_name) { $this->Set($prefix_special . '_event', $event_name); } @@ -534,32 +533,42 @@ { $mod_rw_helper =& $this->Application->recallObject('ModRewriteHelper'); /* @var $mod_rw_helper kModRewriteHelper */ - + $mod_rw_helper->processRewriteURL(); } function getDefaultTemplate($t) { - $t = $this->getTemplateName( trim($t, '/') ); - if (!$t) $t = 'index'; + $t = $this->getTemplateName(trim($t, '/')); + + if ( !$t ) { + $t = 'index'; + } + return trim($t, '/'); } function extractSIDAndTemplate(&$parts) { + $template = ''; $vars = Array (); - $sub_parts = array_shift($parts); - list ($sid, $t) = explode('-', $sub_parts, 2); + if ( preg_match('/^([\d]+|)-(.*)$/', $parts[0], $regs) ) { + // first "env" component matches "sid-template" format + // (will be false, when mod-rewrite url to home page is built) + $sid = $regs[1]; + $template = $regs[2]; + array_shift($parts); - if ($sid) { - // Save Session ID - $this->Set('sid', $sid); - $vars['sid'] = $sid; + if ( $sid ) { + // Save Session ID + $this->Set('sid', $sid); + $vars['sid'] = $sid; + } } // Save Template Name - $vars['t'] = $this->getDefaultTemplate($t); + $vars['t'] = $this->getDefaultTemplate($template); return $vars; } @@ -570,13 +579,13 @@ * set template name and sid in * desired application variables. * - * @param string $env_var enviroment string value + * @param string $env_var environment string value * * @access public */ function processQueryString($env_var, $pass_name = 'passed') { - // env=SID:TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0 + // env=SID-TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0 $vars = Array (); if ($env_var) { $more_vars = strpos($env_var, '&'); @@ -612,7 +621,7 @@ } /** - * Converts enviroment part into variable array (based on query map for given prefix) + * Converts environment part into variable array (based on query map for given prefix) * * @param string $mixed_part * @return Array @@ -659,13 +668,13 @@ */ function getTemplateName($t) { - if (array_key_exists('t', $this->Get) && $this->Get['t']) { + if ( array_key_exists('t', $this->Get) && $this->Get['t'] ) { // template name is passed directly in url (GET method) $t = $this->Get['t']; } // if t was set through env, even in mod_rewrite mode! - if ($this->Get('env') && $this->Application->RewriteURLs() && $this->Get('t')) { + if ( $this->Get('env') && $this->Application->RewriteURLs() && $this->Get('t') ) { $t = $this->Get('t'); }