Post by Orbiter » Sat Dec 17, 2022 12:48 am

3.0.3.8 maintenance on PHP8.1

having a company name with & will return an & in the outputs.

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Orbiter » Sat Dec 17, 2022 3:41 am

Sales/order - all outputs the company field is used in

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

Post by JNeuhoff » Sat Dec 17, 2022 3:47 am

I am unable to reproduce your issue, therefore unable to fix it, unless you can provide some more details on what exactly you did.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Orbiter » Sat Dec 17, 2022 11:34 pm

I have a company that is called J & B Mowers. I can enter the companyname that way but as soon as I place an order and choose that customer / his address 1 the name gets written as J & B Mowers. I can correct it in the order and it stays that way.

The error happens when the & is taken from the customer table, I guess.
It also occurs when I deactivate all extensions.

Maybe it is because of the dash behind the &?

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

Post by Orbiter » Sat Dec 17, 2022 11:52 pm

I can recreate the issue with any Ampersand:
Image
Image

Attachments

Bildschirmfoto 2022-12-17 um 16.51.00.png

Bildschirmfoto 2022-12-17 um 16.51.00.png (68.36 KiB) Viewed 3253 times

Bildschirmfoto 2022-12-17 um 16.50.34.png

Bildschirmfoto 2022-12-17 um 16.50.34.png (57.05 KiB) Viewed 3253 times


New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

Post by Orbiter » Sun Dec 18, 2022 12:12 am

It occurs when I manually add the user in the backend AND when I enter it in the frontend as real life user.
The & is stored as & in the sql database.
If I correct it in the database it is also correct in the order afterwards

I guess the form is not correctly UTF-8 encoded. But I have a hard time finding the form that actually enters data into the table..so many folders everywhere
(I am new to this MVC concept, grown up with Spaghetti coding)

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

Post by ADD Creative » Sun Dec 18, 2022 5:04 am

It's escaped by design in the database.

The issue is there is no html_entity_decode before the JSON encoding in the address function that is called.
https://github.com/opencart/opencart/bl ... 1527-L1539

Strangely the name for the autocomplete is decoded but nothing else.
https://github.com/opencart/opencart/bl ... .php#L1478

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Sun Dec 18, 2022 6:06 am

It's not a function.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Orbiter » Sun Dec 18, 2022 7:15 am

ADD Creative wrote:
Sun Dec 18, 2022 5:04 am
It's escaped by design in the database.

The issue is there is no html_entity_decode before the JSON encoding in the address function that is called.
https://github.com/opencart/opencart/bl ... 1527-L1539

Strangely the name for the autocomplete is decoded but nothing else.
https://github.com/opencart/opencart/bl ... .php#L1478
Is there a easy way to fix that?

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

Post by straightlight » Sun Dec 18, 2022 7:46 am

Orbiter wrote:
Sun Dec 18, 2022 7:15 am
ADD Creative wrote:
Sun Dec 18, 2022 5:04 am
It's escaped by design in the database.

The issue is there is no html_entity_decode before the JSON encoding in the address function that is called.
https://github.com/opencart/opencart/bl ... 1527-L1539

Strangely the name for the autocomplete is decoded but nothing else.
https://github.com/opencart/opencart/bl ... .php#L1478
Is there a easy way to fix that?
You're posting this issue on the forum as well as on Github Opencart and you're asking in the Github Opencart repository where else to post this issue while you already created the topic. Furthermore, a solution where to look has been provided on Github Opencart.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Sun Dec 18, 2022 8:27 am

Orbiter wrote:
Sun Dec 18, 2022 7:15 am
ADD Creative wrote:
Sun Dec 18, 2022 5:04 am
It's escaped by design in the database.

The issue is there is no html_entity_decode before the JSON encoding in the address function that is called.
https://github.com/opencart/opencart/bl ... 1527-L1539

Strangely the name for the autocomplete is decoded but nothing else.
https://github.com/opencart/opencart/bl ... .php#L1478
Is there a easy way to fix that?
It wouldn't be too difficult to add, but you would need to make sure the html_entity_decode didn't create a security issue.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Orbiter » Sun Dec 18, 2022 5:05 pm

I dont know how to do that.
I am under the impression that this is some basic functionallity that every user would enjoy and somehow need.

Posting parallel: I havent figguered out yet where to post what. Since this topic was closed directly on github.

Honestly, the opencart world is very confusing for newbies.
I was under the impression oc is a working system that provides all of the Base functionallity. Now it looks like I need to hire a hole IT group just to get tve address right :-)

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am

Post by ADD Creative » Sun Dec 18, 2022 10:04 pm

Sadly there will be a few issues like you have found. Very rarely is there a version released with just bug fixes. The development is mainly focused on new features.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Mon Dec 19, 2022 11:19 pm

Can someone please try out a bugfix proposal for this as outlined on the corresponding github issue report:

https://github.com/opencart/opencart/is ... 1357824486

And then let me know if this solves it?

The order editor is a rarely used function, and it is even rarer to have ampersands etc in company or name fields, that's why probably nobody else reported it before.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Orbiter » Tue Dec 20, 2022 3:28 am

JNeuhoff wrote:
Mon Dec 19, 2022 11:19 pm
Can someone please try out a bugfix proposal for this as outlined on the corresponding github issue report:

https://github.com/opencart/opencart/is ... 1357824486

And then let me know if this solves it?

The order editor is a rarely used function, and it is even rarer to have ampersands etc in company or name fields, that's why probably nobody else reported it before.
YES it works, just checked. Great work!

New member

Posts

Joined
Tue Nov 22, 2022 3:46 am
Who is online

Users browsing this forum: No registered users and 2 guests