29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

[#22775] Router does not redirect correctly

git-svn-id: http://joomlacode.org/svn/joomla/development/trunk@19074 6f6e1ebd-4c2b-0410-823f-f34bde69bce9
This commit is contained in:
Christophe Demko 2010-10-09 16:45:47 +00:00
parent 2195d4daa4
commit ebda9b9d28
3 changed files with 19 additions and 9 deletions

View File

@ -199,17 +199,22 @@ class JRouterSite extends JRouter
//Need to reverse the array (highest sublevels first)
$items = array_reverse($menu->getMenu());
$found = false;
foreach ($items as $item) {
$lenght = strlen($item->route); //get the lenght of the route
$length = strlen($item->route); //get the length of the route
if ($lenght > 0 && strpos($route.'/', $item->route.'/') === 0 && $item->type != 'menulink') {
$route = substr($route, $lenght);
$vars['Itemid'] = $item->id;
$vars['option'] = $item->component;
if ($length > 0 && strpos($route.'/', $item->route.'/') === 0 && $item->type != 'menulink') {
$route = substr($route, $length);
$found = true;
break;
}
}
if (!$found)
{
$item = $menu->getDefault(JFactory::getLanguage()->getTag());
}
$vars['Itemid'] = $item->id;
$vars['option'] = $item->component;
}
// Set the active menu item
@ -225,7 +230,6 @@ class JRouterSite extends JRouter
*/
if (!empty($route) && isset($this->_vars['option'])) {
$segments = explode('/', $route);
array_shift($segments);
// Handle component route
$component = preg_replace('/[^A-Z0-9_\.-]/i', '', $this->_vars['option']);
@ -332,7 +336,12 @@ class JRouterSite extends JRouter
$tmp = 'component/'.substr($query['option'], 4).'/'.$tmp;
}
$route .= '/'.$tmp;
if ($tmp) {
$route .= '/'.$tmp;
}
elseif ($route=='index.php') {
$route = '';
}
// Unset unneeded query information
if (isset($item) && $query['option'] == $item->component) {

View File

@ -37,6 +37,7 @@ $ -> Language fix or change
# [#22168] patch for [#21804] "Your Profile" has too narrow a focus (Tomasz Narloch)
# [#21804] "Your Profile" has too narrow a focus (Mathavan Jeyadev, Boris Baddenoff)
# [#22555] Use Joomla.submitbutton() instead of submitbutton() (Rouven Weßling)
# [#22775] Router does not redirect correctly
8-Oct-2010 Christophe Demko
# [#22759] Add version, date, author to Hathor (from Tracker # 22482) (thanks Andrea Tarr)

View File

@ -136,7 +136,7 @@ class plgSystemLanguageFilter extends JPlugin
if (self::$mode_sef) {
$uri->delVar('lang');
$uri->setPath($uri->getPath().'/'.$sef.'/');
$uri->setPath($uri->getPath().'/'.$sef);
}
else {
$uri->setVar('lang', $sef);