Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Bug Reports / [Done v155b] Ampersands can't be edited correctly in categories - Fix included

[Done v155b] Ampersands can't be edited correctly in categories - Fix included

Locked

Started by llynix on 1 Jun 2016, 5:23 PM · Views: 2,626

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
1 Jun 2016, 5:23 PM
#1
llynix avatar

llynix

Zen Follower

Join Date:
Jul 2009
Location:
Texas
Posts:
210
Plugin Contributions:
0

[Done v155b] Ampersands can't be edited correctly in categories - Fix included

I've been discovering recently that any of my categories with ampersands were getting messed up. The problem seemed to be that every time an ampersand was used it was translated to &. Then on subsequent edits it would translate to &.

This would cause problems viewing the category on the front end. And the only way around it was to repeatedly remove the added amp; to your category names.

I traced this down, and found htmlspecialchars to be the culprit. Specifically 'categories_name' was not being sanitized correctly in the _POST and as a result was being run through filterStrictSantizeKeys which has an htmlspecialchars in it.

I fixed this by adding 'categories_name' to line 198 like so:

$group = array('pages_title', 'categories_name', 'page_params', 'music_genre_name', 'artists_name', 'record_company_name', 'countries_name', 'name', 'type_name', 'manufacturers_name',
               'title', 'coupon_name', 'banners_title', 'coupon_code', 'group_name', 'geo_zone_name', 'geo_zone_description',
               'tax_class_description', 'tax_class_title', 'tax_description', 'entry_company', 'customers_firstname',
               'customers_lastname', 'entry_street_address', 'entry_suburb', 'entry_city', 'entry_state', 'customers_referral',
               'symbol_left', 'symbol_right');
$sanitizer->addSimpleSanitization('WORDS_AND_SYMBOLS_REGEX', $group);

Not entirely sure if that's the right place. But I do know it fixes this bug.

DentalPlanet Designed/Administrated by Falls Geek

1 Jun 2016, 5:48 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v155b] Ampersands can't be edited correctly in categories - Fix included

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Jun 2016, 1:42 AM
#3
llynix avatar

llynix

Zen Follower

Join Date:
Jul 2009
Location:
Texas
Posts:
210
Plugin Contributions:
0

Re: [Done v155b] Ampersands can't be edited correctly in categories - Fix included

Yes.

But just to check, I installed 1.5.5a and then the latest trustwave security patch. This is the result of changing the Hardware category to Hardware & Stuff and then editing and saving a few times with no change.

Attachment 16392

DentalPlanet Designed/Administrated by Falls Geek

4 Jun 2016, 2:39 AM
#4
llynix avatar

llynix

Zen Follower

Join Date:
Jul 2009
Location:
Texas
Posts:
210
Plugin Contributions:
0

Re: [Done v155b] Ampersands can't be edited correctly in categories - Fix included

I noticed this has been fixed in the latest security patch release. If your having problems, re-applying the security patch with the latest code should fix it.

DentalPlanet Designed/Administrated by Falls Geek

27 Jul 2016, 2:04 PM
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: [Done v155b] Ampersands can't be edited correctly in categories - Fix included

I just did that and though it fixed the problem with titles, I have an ez page link index.php?main_page=index&cPath=15 that the & is being rewritten and breaking the link in the menu.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo