Index: branches/5.2.x/core/kernel/managers/plain_url_processor.php =================================================================== diff -u -N -r14714 -r14751 --- branches/5.2.x/core/kernel/managers/plain_url_processor.php (.../plain_url_processor.php) (revision 14714) +++ branches/5.2.x/core/kernel/managers/plain_url_processor.php (.../plain_url_processor.php) (revision 14751) @@ -28,7 +28,7 @@ { // env=SID-TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0 if ( !$env_var ) { - return Array ('t' => $this->manager->getTemplateName('index')); + return Array ('t' => $this->manager->getTemplateName()); } $vars = Array (); @@ -88,7 +88,7 @@ } // Save Template Name - $vars['t'] = $this->manager->getDefaultTemplate($template); + $vars['t'] = $this->manager->getTemplateName($template); return $vars; } Index: branches/5.2.x/core/kernel/managers/url_manager.php =================================================================== diff -u -N -r14714 -r14751 --- branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14714) +++ branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14751) @@ -1,6 +1,6 @@ Application->GetVarDirect('t', 'Get') !== false ) { // template name is passed directly in url (GET method) $t = $this->Application->GetVarDirect('t', 'Get'); } - - // if t was set through env, even in mod_rewrite mode! - if ( $this->Application->GetVar('env') && $this->Application->RewriteURLs() && $this->Application->GetVar('t') ) { + elseif ( $this->Application->GetVar('env') && $this->Application->RewriteURLs() && $this->Application->GetVar('t') ) { + // if t was set through env, even in mod_rewrite mode! $t = $this->Application->GetVar('t'); } - - return preg_replace('/\.tpl$/', '', $t); - } - - /** - * Returns current template, replacing it with default when it's missing - * - * @param string $t - * @return string - * @access public - */ - public function getDefaultTemplate($t) - { - $t = $this->getTemplateName(trim($t, '/')); - - if ( !$t ) { - $t = 'index'; + else { + $t = trim($default_template ? $default_template : 'index', '/'); } - return trim($t, '/'); + return trim(preg_replace('/\.tpl$/', '', $t), '/'); } } \ No newline at end of file Index: branches/5.2.x/core/kernel/managers/rewrite_url_processor.php =================================================================== diff -u -N -r14737 -r14751 --- branches/5.2.x/core/kernel/managers/rewrite_url_processor.php (.../rewrite_url_processor.php) (revision 14737) +++ branches/5.2.x/core/kernel/managers/rewrite_url_processor.php (.../rewrite_url_processor.php) (revision 14751) @@ -312,13 +312,10 @@ if ( !$url_parts ) { $this->_initAll(); - $vars['t'] = $this->Application->UrlManager->getDefaultTemplate(''); + $vars['t'] = $this->Application->UrlManager->getTemplateName(); return $vars; } - else { - $vars['t'] = ''; - } $this->_parseLanguage($url_parts, $vars); $this->_parseTheme($url_parts, $vars);