Forums / Bug Reports / Sanitizer issue on product description edits with embedded images

Sanitizer issue on product description edits with embedded images

Views: 10,670

Results 1 to 12 of 12
29 May 2016, 7:49 PM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Sanitizer issue on product description edits with embedded images

I'm using a little right chevron ► in the product description that shows up correctly on preview but is saved as ? in the database. This used to work.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

29 May 2016, 8:47 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: Sanitizer issue on product description edits with embedded images

No, I have the latest Trustwave updates + 155a.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

29 May 2016, 8:53 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Sanitizer issue on product description edits with embedded images

Oh well, I had this issue and replacing these files corrected it for my install
/admin/includes/classes/AdminRequestSanitizer.php
/admin/includes/init_includes/init_sanitize.php

Zen-Venom Get Bitten

29 May 2016, 9:06 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Sanitizer issue on product description edits with embedded images

To what charset is the database set? Template?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 May 2016, 9:37 PM
#6
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,927
Plugin Contributions:
3

Re: Sanitizer issue on product description edits with embedded images

Hmmm

product description is probably the most permissive field as far as admin sanitizer is concerned.

How do you enter the chevron. As an html entity ?

29 May 2016, 9:47 PM
#7
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,927
Plugin Contributions:
3

Re: Sanitizer issue on product description edits with embedded images

Did a quick test on my v155 branch.
Copy/pasted a chevron into a description.
saved OK and displays OK in admin/catalog

30 May 2016, 12:07 PM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: Sanitizer issue on product description edits with embedded images

Thanks for confirming, @wilt.

Did some digging and found the root cause was that the database was latin1. Converted to UTF8 using Andrew's script:
https://www.zen-cart.com/downloads.php?do=file&id=1318

and the problem was resolved.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

30 May 2016, 12:13 PM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,116
Plugin Contributions:
56

Re: Sanitizer issue on product description edits with embedded images

swguy:

Thanks for confirming, @wilt.

Did some digging and found the root cause was that the database was latin1. Converted to UTF8 using Andrew's script:
https://www.zen-cart.com/downloads.php?do=file&id=1318

and the problem was resolved.
@swguy, I've got to disagree that the problem was *resolved *by converting the database to utf8. Isn't Zen Cart supposed to operate properly on latin1/iso-8559-1 setups, too? If so, you've found a work-around for the problem, but not the solution.

30 May 2016, 12:19 PM
#10
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: Sanitizer issue on product description edits with embedded images

It does but the charset (in the configure files) and database have to agree - I had set the charset to utf8 but failed to update the database accordingly. Prior incarnations of this system had charset iso-8859-1, so it all worked.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

30 May 2016, 12:34 PM
#11
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,116
Plugin Contributions:
56

Re: Sanitizer issue on product description edits with embedded images

I'm confused, swguy, was it that the database still had a latin1-based collation but the DB_CHARSET value was updated to utf-8?

30 May 2016, 12:48 PM
#12
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: Sanitizer issue on product description edits with embedded images

Correct.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.