Post by CedSha » Sun May 04, 2025 12:27 am

Hello there,
( In OC V4.1.0.3 )
I had some malformed URL to my site which lead to an error message, recorded in the log file.
Trying to access array offset on value of type null in .../catalog/controller/common/language.php on line 53
I think instead it should redirect to the default language.
Here one sample of malformed request :
/index.php?route=product/product&language=../&manufacturer_id=11&product_id=183&page=7
I updated code like this :
after this code - Near line 35 /catalog/controller/common/language.php

Code: Select all

$code = $data['code'];
I put

Code: Select all

// If the code not in array we fallback to default language
if (!isset($data['languages'][$code]['code'])) {
    $code = $this->config->get('config_language');
}
HTH

Image


User avatar
New member

Posts

Joined
Mon Sep 18, 2023 1:01 am


Post by CedSha » Mon May 05, 2025 3:16 pm

BTW - I opened an issue on Github > #14852

Image


User avatar
New member

Posts

Joined
Mon Sep 18, 2023 1:01 am


Post by by mona » Mon May 05, 2025 6:03 pm

@CedSha Thankyou
+1

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am
Who is online

Users browsing this forum: No registered users and 0 guests