Skip to content

Commit

Permalink
[3.10] [PHP 8.1] Fixes Router/Route.php deprecated null to string in …
Browse files Browse the repository at this point in the history
…strpos() (joomla#36798)

* [3.10] [PHP 8.1] Fixes Router/Route.php deprecated null to string in strpos()

Fixes `Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in libraries/src/Router/Route.php on line 124`

* [PHP 8.1] Better fix to avoid deprecation proposed by @zero-24

Co-authored-by: Tobias Zulauf <[email protected]>

* Revert previous commit for different fix in mod_breadcrumbs/helper.php

* [PHP 8.1] Better fix for joomla#36798 mod_breadcrumbs with null link in last item

Co-authored-by: Tobias Zulauf <[email protected]>
  • Loading branch information
beat and zero-24 authored Jan 23, 2022
1 parent 5ed8cdd commit e712ad7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/mod_breadcrumbs/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function getList(&$params)
{
$crumbs[$i] = new stdClass;
$crumbs[$i]->name = stripslashes(htmlspecialchars($items[$i]->name, ENT_COMPAT, 'UTF-8'));
$crumbs[$i]->link = JRoute::_($items[$i]->link);
$crumbs[$i]->link = !is_null($items[$i]->link) ? JRoute::_($items[$i]->link) : '';
}

if ($params->get('showHome', 1))
Expand Down

0 comments on commit e712ad7

Please sign in to comment.