Page 1 of 1

Search text contain " show error

Posted: Thu Jan 18, 2024 10:48 am
by jsling
When attempting to search for text containing double quotes (") , an error screen is displayed.


Error occur at common/language.php -> $this->url->link($route, 'language=' . $result['code'] . $url, true)

Code: Select all

		foreach ($results as $result) {
			$this->config->set('config_language_id', $result['language_id']);


			$data['languages'][] = [
				'name'  => $result['name'],
				'code'  => $result['code'],
				'image' => $result['image'],
				'href'  => $this->url->link($route, 'language=' . $result['code'] . $url, true)
			];
		}

Re: Search text contain " show error

Posted: Thu Jan 18, 2024 10:50 am
by Cue4cheap
What OC version?
Looks like a test site... did you do a basic install without any modifications?
Mike

Re: Search text contain " show error

Posted: Thu Jan 18, 2024 10:54 am
by jsling
Version 4.
It also happen on the demo https://demo.opencart.com/

Re: Search text contain " show error

Posted: Thu Jan 18, 2024 11:38 am
by Cue4cheap
jsling wrote:
Thu Jan 18, 2024 10:54 am
Version 4.
It also happen on the demo https://demo.opencart.com/
"Version 4" What? Right now the latest is 4.0.2.3 and there are 6 prior versions.

Re: Search text contain " show error

Posted: Thu Jan 18, 2024 3:55 pm
by jsling
Yes. I using version 4.0.2.3.

Re: Search text contain " show error

Posted: Thu Jan 18, 2024 6:27 pm
by jsling
Found the log..
2024-01-18 18:23:35 - PHP Warning: Undefined array key 1 in /home/public_html/catalog/controller/startup/seo_url.php on line 73

Re: Search text contain " show error

Posted: Thu Jan 18, 2024 6:54 pm
by jsling
fixed the issues by modifying this code
catalog/controller/startup/seo_url.php line 70

Code: Select all

		$parts = explode('&', $url_info['query']);    

Code: Select all

		$parts = explode('&', html_entity_decode($url_info['query']));    

Re: Search text contain " show error

Posted: Fri Jan 19, 2024 7:00 pm
by ADD Creative
The problem is probably related to the way catalog/controller/common/currency.php and catalog/controller/common/language.php build the redirect URLs.