Post by RobertoZST » Sat Jan 13, 2018 2:40 am

Hello, when in my store someone in the page search do a search of a product and in select also the description it doesn't work because the url is wrong. It is like this: http://www.lilnap.com/cerca?search=maialino&description=true

how can I fix it?

Newbie

Posts

Joined
Sat Jan 13, 2018 2:35 am

Post by straightlight » Sat Jan 13, 2018 10:51 pm

See if this solution resolves the issue: https://stackoverflow.com/questions/348 ... a-htaccess

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 MrPhil » Sun Jan 14, 2018 1:43 am

Even better, find out why the & in the assembled URL is being converted somewhere to a &. and fix it (perhaps an unnecessary or too-late htmlentities() or htmlspecialchars() call? urlencode() might be a better choice). The URL produced should have & in it instead of &, so it's better to fix it at the source than to patch it up in the .htaccess. You certainly can temporarily patch it in .htaccess until you've found the source of the problem and fixed it, but .htaccess is not a good long-term solution.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by straightlight » Sun Jan 14, 2018 3:15 am

My previous reply on the above is, indeed, to know the different between back and then. Not necessarily as a permanent solution since most of the users still won't know where their reported issues originates from. Otherwise, they wouldn't necessarily need to report it.

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 MrPhil » Mon Jan 15, 2018 1:18 am

Well, naive users might get the impression that the proper permanent fix is to futz it in .htaccess to convert & to &, while real programmers know that this is at best a temporary workaround, and the offending code needs to be fixed. I just wanted to clarify that point. You need to be careful in making statements that can be misunderstood by non-professional developers (e.g., merchants just trying to sell stuff).

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by straightlight » Mon Jan 15, 2018 1:31 am

MrPhil wrote:
Mon Jan 15, 2018 1:18 am
Well, naive users might get the impression that the proper permanent fix is to futz it in .htaccess to convert & to &, while real programmers know that this is at best a temporary workaround, and the offending code needs to be fixed. I just wanted to clarify that point. You need to be careful in making statements that can be misunderstood by non-professional developers (e.g., merchants just trying to sell stuff).
This is what we call: Part of the troubleshooting process.

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 RobertoZST » Tue Jan 16, 2018 7:58 pm

thanks for your support at all. At moment I have add the lines in htaccess, but how can I understand where the issue is?

thanks

Newbie

Posts

Joined
Sat Jan 13, 2018 2:35 am

Post by MrPhil » Wed Jan 17, 2018 1:08 am

So you have the rewrite in .htaccess to temporarily fix incoming & to &? OK, just remember that's only a temporary fix. As to where the problem lies, it's in your PHP code somewhere, probably in an extension or custom code. What OC version are you at, and what extensions are installed? If you want to look for it yourself (which you should at least try to do), it's probably an htmlentities() or htmlspecialchars() call being applied to a built Query String. What it should probably be using is urlencode().

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by RobertoZST » Wed Jan 17, 2018 2:01 am

MrPhil wrote:
Wed Jan 17, 2018 1:08 am
So you have the rewrite in .htaccess to temporarily fix incoming & to &? OK, just remember that's only a temporary fix. As to where the problem lies, it's in your PHP code somewhere, probably in an extension or custom code. What OC version are you at, and what extensions are installed? If you want to look for it yourself (which you should at least try to do), it's probably an htmlentities() or htmlspecialchars() call being applied to a built Query String. What it should probably be using is urlencode().
Yes I undestand it is only a temporary fix, but really I don't know how fix the issue.I will check at first the extensions.

Thank you

Newbie

Posts

Joined
Sat Jan 13, 2018 2:35 am
Who is online

Users browsing this forum: No registered users and 67 guests