I'm moving this discussion over from another support thread (http://www.zen-cart.com/showthread.p...ng-array-given).... I'm using ZC 1.5.1 and PHP 5.3.
I believe I've found a problem with Supertracker. Specifically it seems to be when a user checks out and Supertracker attempts to write the cart contents to the cart_contents field in the supertracker table. The file that controls this, I believe, is /includes/classes/supertracker.php about line 150ish. You can see that if the cart contents return as a string then it serializes them. But what happens when they don't return as a string? What if they are undefined or an array or some other non-string condition. Since the database write operation depends on zen_db_input() function, which is really just a container for the native add_slashes() function, it causes a PHP warning. Under PHP 5.3 addslashes() now strictly checks to see if the data passed to it is a string. If it isn't it throws a warning which ends up as a myDEBUG log file in the /logs folder under Zen Cart 1.5.1. They start adding up quickly if you have a store with enough daily transactions.
If I pass this data straight into the db, bypassing addslashes, it writes "Array" at least in my initial couple tests.
Suggestions on the best way to filter the $carts_content variable so it always ends up a string? I'll try a couple things but just wanted others to weigh in....
Thanks!


Reply With Quote


