From e712ad7b8e7460edac0b6bf969249bcfcbef9f4e Mon Sep 17 00:00:00 2001 From: beat Date: Sun, 23 Jan 2022 20:56:12 +0100 Subject: [PATCH] [3.10] [PHP 8.1] Fixes Router/Route.php deprecated null to string in strpos() (#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 * Revert previous commit for different fix in mod_breadcrumbs/helper.php * [PHP 8.1] Better fix for #36798 mod_breadcrumbs with null link in last item Co-authored-by: Tobias Zulauf --- modules/mod_breadcrumbs/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mod_breadcrumbs/helper.php b/modules/mod_breadcrumbs/helper.php index b07ed35e01abd..be75a4c6a6798 100644 --- a/modules/mod_breadcrumbs/helper.php +++ b/modules/mod_breadcrumbs/helper.php @@ -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))