Skip to content

Commit

Permalink
Fix $language default parameter (#39434)
Browse files Browse the repository at this point in the history
  • Loading branch information
janschoenherr authored Dec 28, 2022
1 parent d9e2152 commit 750679f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/com_content/src/Helper/RouteHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ abstract class RouteHelper
*
* @param integer $id The route of the content item.
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null)
public static function getArticleRoute($id, $catid = 0, $language = null, $layout = null)
{
// Create the link
$link = 'index.php?option=com_content&view=article&id=' . $id;
Expand All @@ -45,7 +45,7 @@ public static function getArticleRoute($id, $catid = 0, $language = 0, $layout =
$link .= '&catid=' . $catid;
}

if ($language && $language !== '*' && Multilanguage::isEnabled()) {
if (!empty($language) && $language !== '*' && Multilanguage::isEnabled()) {
$link .= '&lang=' . $language;
}

Expand Down

0 comments on commit 750679f

Please sign in to comment.