Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / PHP 5.4.4 dropping product descriptions

PHP 5.4.4 dropping product descriptions

Locked

Views: 22,142

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
12 Jul 2013, 7:04 AM
#1
littelbird avatar

littelbird

New Zenner

Join Date:
Jul 2013
Location:
South Africa
Posts:
1
Plugin Contributions:
0

PHP 5.4.4 dropping product descriptions

I'm running version ZC ver 1.3.8a patched to 1.3.9f. Original official download and upgrade. The site has been running perfectly for the last year until my ISP upgraded their servers from PHP 5.3.3 to 5.4.4.

Everything seemed fine until I needed to edit the product description of an existing product. After saving the change, I found that the product description was now blank. I ran a few tests and it seems to accept short simple text entries, but as soon as I enter long descriptions, the field goes blank. Rolling the server back to PHP 5.3.3 immediately resolves the problem. My ISP tells me that PHP 5.4.4 no longer supports "register_globals" and they suspect this may be the problem. Does anyone know if there is a quick fix for ZC 1.3.9 to allow for PHP 5.4.4 or should I just bite the bullet and upgrade my site to the latest ZC version?

12 Jul 2013, 9:47 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: PHP 5.4.4 dropping product descriptions

Zen Cart has never used "register_globals", so it can't be that.

23 Jul 2013, 7:34 PM
#3
generikz avatar

generikz

New Zenner

Join Date:
Sep 2011
Location:
Tokyo
Posts:
26
Plugin Contributions:
0

Re: PHP 5.4.4 dropping product descriptions

LittelBird:

I'm running version ZC ver 1.3.8a patched to 1.3.9f. Original official download and upgrade. The site has been running perfectly for the last year until my ISP upgraded their servers from PHP 5.3.3 to 5.4.4.

Thanks for your message! These silently dropping descriptions were driving me crazy (collation? SQL? no log, no error....)

I just moved my ZC 1.3.9h from Debian 6 (Mysql 5.1.x, PHP 5.3.x) to Debian 7 (Mysql 5.5.x, PHP 5.4.x) and had exactly the same problem. Another collateral damage was that the HTML Editor settings would be discarded and only HTML Area was loading. There might be a few more but everything else seemed to work as before.

I do not have time to upgrade to ZC 1.5.x, as it is a scary adventure given the number of patches I added to the my 1.3.9h over the years.

This URL gave the full steps for Debian 7: http://blog.wpkg.org/2013/06/20/downgrading-to-php-5-3-on-debian-wheezy-7-0/

Julien

18 Sep 2013, 11:22 PM
#4
danilzan avatar

danilzan

New Zenner

Join Date:
Jul 2011
Posts:
3
Plugin Contributions:
0

Re: PHP 5.4.4 dropping product descriptions

As of PHP 5.4 they changed default encoding from "ISO-8859-1" to "UTF-8". So you get null from htmlspecialchars.
edit /admin/includes/modules/product/preview_info.php
add to end of line 191:
htmlspecialchars(stripslashes($products_description[$languages[$i]['id']]), ENT_COMPAT,'ISO-8859-1', true));

19 Sep 2013, 10:22 AM
#5
lat9 avatar

lat9

Administrator

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

Re: PHP 5.4.4 dropping product descriptions

danilzan:

As of PHP 5.4 they changed default encoding from "ISO-8859-1" to "UTF-8". So you get null from htmlspecialchars.
edit /admin/includes/modules/product/preview_info.php
add to end of line 191:
htmlspecialchars(stripslashes($products_description[$languages[$i]['id']]), ENT_COMPAT,'ISO-8859-1', true));
Exactly! Your store's database is set to use one of the latin1 character sets, but PHP 5.4 and later apply UTF-8 encoding as the new default for both the htmlspecialchars and htmlentities calls. There are many, many more file changes in addition to the one that danilzan referenced that were changed in the move from v1.5.0 to v1.5.1 to support those changes.

7 Apr 2014, 2:45 PM
#6
robyweb avatar

robyweb

New Zenner

Join Date:
Mar 2007
Posts:
22
Plugin Contributions:
0

Re: PHP 5.4.4 dropping product descriptions

I have the same problem with an old 1.3.0 version ... blank descriptionThere is a solution ?

28 Jul 2014, 8:28 AM
#7
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: PHP 5.4.4 dropping product descriptions

I have 1.38a sites which since the weekend are now running on PHP5.4.3 and no errors logged, all sites working fine, apart from the missing fields on any pages that have special characters. All fixed now because of this, thanks.

29 Jul 2014, 3:20 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: PHP 5.4.4 dropping product descriptions

dgent:

I have 1.38a sites which since the weekend are now running on PHP5.4.3 and no errors logged, all sites working fine, apart from the missing fields on any pages that have special characters. All fixed now because of this, thanks.

You REALLY need to upgrade ASAP. There are other issues you'll start having problems with if you don't.