Skip to content

Commit 7df622b

Browse files
authored
[5.4][PHP8.5] Using null as an array offset is now deprecated (joomla#46201)
1 parent 4085cac commit 7df622b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

libraries/src/Application/SiteApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ protected function route()
813813
new AfterRouteEvent('onAfterRoute', ['subject' => $this])
814814
);
815815

816-
$Itemid = $this->input->getInt('Itemid', null);
816+
$Itemid = $this->input->getInt('Itemid', 0);
817817
$this->authorise($Itemid);
818818
}
819819

modules/mod_login/src/Helper/LoginHelper.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,23 @@ class LoginHelper
4141
*/
4242
public function getReturnUrlString(Registry $params, $type, CMSApplicationInterface $app): string
4343
{
44-
$item = $app->getMenu()->getItem($params->get($type));
45-
4644
// Stay on the same page
4745
$url = Uri::getInstance()->toString();
4846

49-
if ($item) {
50-
$lang = '';
47+
$returnMenuId = $params->get($type, 0);
5148

52-
if ($item->language !== '*' && Multilanguage::isEnabled()) {
53-
$lang = '&lang=' . $item->language;
54-
}
49+
if ($returnMenuId > 0) {
50+
$item = $app->getMenu()->getItem($returnMenuId);
51+
52+
if ($item) {
53+
$lang = '';
5554

56-
$url = 'index.php?Itemid=' . $item->id . $lang;
55+
if ($item->language !== '*' && Multilanguage::isEnabled()) {
56+
$lang = '&lang=' . $item->language;
57+
}
58+
59+
$url = 'index.php?Itemid=' . $item->id . $lang;
60+
}
5761
}
5862

5963
return base64_encode($url);

0 commit comments

Comments
 (0)