Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default [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
    Code:
    if (isset($value->fields['value']) && $value->fields['value']) {
    Add after
    Code:
    $value->fields['value'] = base64_decode($value->fields['value']);
    Find ~62 line
    Code:
    $value = $val;
    Add after
    Code:
    $value = base64_encode($value);
    includes/classes/cache.php
    Find ~127 line
    Code:
    $result_serialize = $db->prepare_input(serialize($zf_result_array));
    Add after
    Code:
    $result_serialize = base64_encode($result_serialize);
    Find ~155 line
    Code:
    $zp_cache_result = $db->Execute($sql);
    Add after
    Code:
    $zp_cache_result->fields['cache_data'] = base64_decode($zp_cache_result->fields['cache_data']);

  2. #2
    Join Date
    Aug 2004
    Location
    Saint Petersburg, Russia
    Posts
    1,786
    Plugin Contributions
    13

    Default Re: [Done v1.3.9] UTF-8 session and cache problems

    Both files need to edit - in the shop and in the admin. You also need to edit the admin/whos_online.php:
    Find
    Code:
    $session_data = trim($session_data->fields['value']);
    add after
    Code:
    $session_data = base64_decode($session_data);

 

 

Similar Threads

  1. v139h Problems installing 139h with UTF-8 support and cyrillic symbols
    By the.rampage.rado in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 15 Jan 2012, 01:21 AM
  2. Problems with displaying Russian characters and UTF-8
    By pcontente in forum Addon Language Packs
    Replies: 31
    Last Post: 4 Mar 2011, 03:22 PM
  3. [Done v1.3.8] Database cache bug and fix
    By bouncingltd in forum Bug Reports
    Replies: 19
    Last Post: 14 Jul 2009, 03:26 PM
  4. Session Cache problems
    By PhillipJFey in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 28 Oct 2008, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg