So you upgraded to 1.3.9 G and everything seemed ok until you updated your main page, or other defined pages content…. Not to worry, the Zen Cart team has a fix for this. I will explain this for you in detail, so you can correctly whitelist and fix these and other functions that rely on the HTML parsing in your Zen Cart. Note that all of your admin previews are also not parsing the HTML and you see them as code in preview… This is not a mistake and protects you against the possible execution of scripts in the defined area and XSS injection. I imagine that eventually the “preview” button will simply be removed and we will have just “save” like other areas.
First of all Zen Cart 13.9 version G was released to fix XSS vulnerabilities and you MUST upgrade to G to be protected. That being said I have some upgrade notes for you, first the all important change log.
Changed Files (since release of v1.3.9f)
- /admin/includes/init_includes/init_sanitize.php (NEW file)
- /docs/ <VARIOUS FILES HERE>
- /includes/classes/payment.php ***
- /includes/modules/payment/paypal/tpl_ec_button.php ***
- /zc_install/ … assume all of /zc_install/ has changed
Deleted Files (since release of v1.3.9a/b/c/d/e/f)
- /admin/includes/languages/english/cache.php (deleted in 1.3.9g)
- /admin/includes/functions/gzip_compression.php (deleted in 1.3.9f)
- /includes/functions/gzip_compression.php (deleted in 1.3.9f)
New Files (since release of v1.3.9a/b/c/d/e/f)
Moved Files (since release of v1.3.9a/b/c/d/e/f)
*** These changes were omitted from the changelog and reported by the Zen cart team on 9/29/2010
As always, it is very important that you merge your customizations in to the new files for changed files. In the F to G upgrade, note specifically that many payment modules were changed. The safest way to upgrade these is to record your settings for Authorize.net and PayPal, uninstall the modules , upload the files and reinstall and reconfigure the modules. There is no database upgrade to complete, but it is always a best practice to do a full site backup (including your database) before proceeding to upgrade your Zen Cart.
Zen Cart 1.3.9G takes a VERY aggressive stand on security and you may have some issues with the htaccess files and other new security features…. Such as:
- Your defined pages and other HTML parsing addon modules not converting your entries in to HTML
- Your admin if not renamed will simply not work at all
- Your catalog configure file will attempt to set it’s permissions correctly to 444 (You should still set your admin one!)
The issue with the HTML not being properly converted to code is an issue that will likely be resolved in the coming Zen Cart 1.3.9H, however, addons and such which need to use this function will continue to use the following fix and treat it as a permanent solution.
How to Whitelist your Defined Pages
To fix your defined pages for example, you will create a .php file such as this
<?php $global_xss_whitelist = isset($global_xss_whitelist) ? $global_xss_whitelist : array(); $my_whitelist = array('file_contents'); $global_xss_whitelist = array_merge($my_whitelist, $global_xss_whitelist);
Note the “my_whitelist” array, this is also where you will add thewhitelist fix if you are having issues with your banners… Like this
<?php $global_xss_whitelist = isset($global_xss_whitelist) ? $global_xss_whitelist : array(); $my_whitelist = array('file_contents', 'banners_html_text'); $global_xss_whitelist = array_merge($my_whitelist, $global_xss_whitelist);
Additionally you can add the following for the short description module as well….
<?php $global_xss_whitelist = isset($global_xss_whitelist) ? $global_xss_whitelist : array(); $my_whitelist = array('file_contents', 'banners_html_text', 'categories_description_sub'); $global_xss_whitelist = array_merge($my_whitelist, $global_xss_whitelist);
Other modules you come across which require whitelisting would be completed in the same manner. This file once complete is named extra_white_list.php then uploaded to
To make things a bit easier for you we have the file here…. Just download it and rename it from .txt to .php.
One Response to “Help, Zen Cart 1.3.9 G Broke My Defined Pages!”
Leave a Reply
You must be logged in to post a comment.