Harden WP eCommerce against APC cache deserialization errors #1835
Harden countries class against bad cache based on issues noted on sites using GoDaddy APC caching reported here:
…void errors such as this: Fatal error: WPSC_Countries::_dirty(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 1142"
…o encode and serialize the data. Done to work around fatal error on some hosts using APC 3.1.12 or newer that happens when APC tries to deserialize a transient that contains an array of objects, or objects that contain other objects. Issue is discussed here: https://wordpress.org/support/topic/fatal-error-wpsc_countries/page/2?replies=60#post-6819037
@JeffPyeBrook Would like to see 273acd1 mostly reverted, aside from the function definitions. Would like to keep this PR as tightly scope and low-touch as possible. We're dealing with an edge case here, and I'd like the PR to solve the reported issue. Trying to solve issues we're not yet having can only lead to pain and suffering.
… decoded string, and even cause an infinite loop, crash or other bad stuff when a corrupted transient is returned