Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

# [#30430] Severe bug with "com_content" component routing. Thanks

sajal soni and Elin.
  • Loading branch information...
commit 2c77c35719e854fcfd290505e855b2f7b76d1777 1 parent 5d87568
@infograf768 infograf768 authored
View
1  components/com_content/helpers/route.php
@@ -31,6 +31,7 @@ public static function getArticleRoute($id, $catid = 0, $language = 0)
);
//Create the link
$link = 'index.php?option=com_content&view=article&id='. $id;
+
if ((int) $catid > 1)
{
$categories = JCategories::getInstance('Content');
View
7 components/com_content/router.php
@@ -326,8 +326,11 @@ function ContentParseRoute($segments)
}
else
{
- $vars['view'] = 'category';
- $vars['id'] = $cat_id;
+ if ($cat_id > 0)
+ {
+ $vars['view'] = 'category';
+ $vars['id'] = $cat_id;
+ }
}
return $vars;
View
1  installation/CHANGELOG
@@ -37,6 +37,7 @@ $ -> Language fix or change
# [#29377] Image select. Thanks Constantin Romankiewicz
# [#29961] RAW filter is missing for JInput. Thanks Cedric Keiflin
# [#30427] Remove 1.5 html methods from com_newsfeeds. Thanks Elin
+ # [#30430] Severe bug with "com_content" component routing. Thanks sajal soni and Elin.
03-Apr-2013 Jean-Marie Simonet
# [#30349] Cleaned up use of database & query objects. Thanks Peter van Westen and Michael Babker
View
14 libraries/cms/router/site.php
@@ -242,6 +242,7 @@ protected function _parseSefRoute($uri)
// Set the active menu item
$menu->setActive($vars['Itemid']);
}
+
return $vars;
}
@@ -249,6 +250,7 @@ protected function _parseSefRoute($uri)
* Parse the application route
*/
$segments = explode('/', $route);
+
if (count($segments) > 1 && $segments[0] == 'component')
{
$vars['option'] = 'com_' . $segments[1];
@@ -275,7 +277,7 @@ protected function _parseSefRoute($uri)
// Get the length of the route
$length = strlen($item->route);
if ($length > 0 && JString::strpos($route_lowercase . '/', $item->route . '/') === 0
- && $item->type != 'menulink' && (!$app->getLanguageFilter() || $item->language == '*'
+ && $item->type != 'menulink' && (!JLanguageMultilang::isEnabled() || $item->language == '*'
|| $item->language == $lang_tag))
{
// We have exact item for this language
@@ -294,7 +296,7 @@ protected function _parseSefRoute($uri)
if (!$found)
{
- $found = $menu->getDefault($lang_tag);
+ return false;
}
else
{
@@ -304,9 +306,11 @@ protected function _parseSefRoute($uri)
$route = substr($route, 1);
}
}
-
- $vars['Itemid'] = $found->id;
- $vars['option'] = $found->component;
+ if (isset($found->id) && $found->id)
+ {
+ $vars['Itemid'] = $found->id;
+ $vars['option'] = $found->component;
+ }
}
// Set the active menu item
View
15 libraries/joomla/application/router.php
@@ -180,10 +180,19 @@ public function parse($uri)
// Parse SEF URL
if ($this->_mode == JROUTER_MODE_SEF)
{
- $vars += $this->_parseSefRoute($uri);
- }
+ $routevars = $this->_parseSefRoute($uri);
+
+ if (($routevars === false))
+ {
+ return array();
+ }
+ else
+ {
+ $vars += $routevars;
- return array_merge($this->getVars(), $vars);
+ return array_merge($this->getVars(), $vars);
+ }
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.