Deceased
- Join Date:
- Aug 2004
- Location:
- Saint Petersburg, Russia
- Posts:
- 1,782
- Plugin Contributions:
- 5
[Done v1.3.9a] UTF-8 session and cache problems
Hi,
I have a problems with session and cache when they stored in db.
zen-cart 1.3.8a
MySQL 5.1.33-log, PHP: 5.2.10 (Zend: 2.2.0)
MySQL 5.0.18-max-log, PHP: 5.2.1 (Zend: 2.2.0)
Both fields TABLE_DB_CACHE'[cache_data'] and TABLE_SESSIONS['value'] are mediumblob.
The problem arises only when write/read information containing characters in utf-8.
My solution.
includes/functions/sessions.php
Find ~43 line
if (isset($value->fields['value']) && $value->fields['value']) {
Add after
$value->fields['value'] = base64_decode($value->fields['value']);
Find ~62 line
$value = $val;
Add after
$value = base64_encode($value);
includes/classes/cache.php
Find ~127 line
$result_serialize = $db->prepare_input(serialize($zf_result_array));
Add after
$result_serialize = base64_encode($result_serialize);
Find ~155 line
$zp_cache_result = $db->Execute($sql);
Add after
$zp_cache_result->fields['cache_data'] = base64_decode($zp_cache_result->fields['cache_data']);