Page 1 of 1

{SOLVED] Posting code on this forum

Posted: Fri Jul 04, 2025 10:33 pm
by gunownergear
Hello,
I cannot figure out how to post error codes on this forum.
When I copy and paste the code, and then submit, I get the "blocked" page.
Can someone let me know how to do this properly.
Thank you,
Dan

Re: Posting code on this forum

Posted: Fri Jul 04, 2025 10:41 pm
by Cue4cheap
gunownergear wrote:
Fri Jul 04, 2025 10:33 pm
Hello,
I cannot figure out how to post error codes on this forum.
When I copy and paste the code, and then submit, I get the "blocked" page.
Can someone let me know how to do this properly.
Thank you,
Dan
Are you using the </> for "code display"?

Re: Posting code on this forum

Posted: Fri Jul 04, 2025 10:59 pm
by gunownergear
Yes, still get "sorry you have been blocked"

Re: Posting code on this forum

Posted: Fri Jul 04, 2025 11:05 pm
by khnaz35
Yes you should post it between the tags

Code: Select all

Your code here

Re: Posting code on this forum

Posted: Fri Jul 04, 2025 11:42 pm
by gunownergear
Just tried it in this reply
won't let me

Re: Posting code on this forum

Posted: Fri Jul 04, 2025 11:46 pm
by gunownergear
2025-06-20 20:26:55 - PHP Warning: Undefined array key "en-gb'" in /home/gunowner/public_html/catalog/controller/common/language.php on line 37

Code: Select all

$data['name'] = $data['languages'][$code]['name'];
Ah there it worked

I will try a new post- Thank You

Re: Posting code on this forum

Posted: Sat Jul 05, 2025 12:16 am
by khnaz35
What is your opencart version and the php version ?

Re: Posting code on this forum

Posted: Sat Jul 05, 2025 12:19 am
by gunownergear
khnaz35 wrote:
Sat Jul 05, 2025 12:16 am
What is your opencart version and the php version ?
Sorry it is 4.1.0.3
PHP is 8.3.22

Re: Posting code on this forum

Posted: Sat Jul 05, 2025 12:35 am
by khnaz35
gunownergear wrote:
Sat Jul 05, 2025 12:19 am
it is 4.1.0.3
PHP is 8.3.22
Change the line with this

Code: Select all

$code = $data['code'];
$code = trim($code, " \t\n\r\0\x0B'\"");

if (isset($data['languages'][$code])) {
	$data['name'] = $data['languages'][$code]['name'];
	$data['image'] = $data['languages'][$code]['image'];
} else {
	$data['name'] = '';
	$data['image'] = '';
}

Re: Posting code on this forum

Posted: Sat Jul 05, 2025 4:38 am
by gunownergear
OK Thank you.
I did now I will monitor, let you know