Ignore:
Timestamp:
09/02/2010 12:38:57 AM (21 months ago)
Author:
ofer
Message:

Fixed bugs noticed by Nicholas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_db.php

    r519 r533  
    7676        } 
    7777        logger("Cache fetched: $original => $cached", 4); 
    78         if ($cached !== null) $cached = explode('_', $cached, 2); 
     78        if ($cached !== null && $cached !== false) 
     79                $cached = explode('_', $cached, 2); 
    7980        return $cached; 
    8081    } 
     
    164165            $this->translations[$row['original']] = array($row['source'], stripslashes($row['translated'])); 
    165166        } 
    166         logger('prefetched: '.count($this->translations), 5); 
     167        logger('prefetched: ' . count($this->translations), 5); 
    167168    } 
    168169 
     
    221222        $translation = $GLOBALS['wpdb']->escape(html_entity_decode($translation, ENT_NOQUOTES, 'UTF-8')); 
    222223        // The translation might be cached (notice the additional postfix) 
    223         list($rev,$cached) = $this->cache_fetch('R_' . $translation, $lang); 
     224        list($rev, $cached) = $this->cache_fetch('R_' . $translation, $lang); 
    224225        if ($rev == 'r') { 
    225226            logger("Exit from cache: $translation $cached", 4); 
     
    241242 
    242243        // we can store the result in the cache (or the fact we don't have one) 
    243         $this->cache_store('R_' . $translation, $lang, array('r',$original), TP_CACHE_TTL); 
     244        $this->cache_store('R_' . $translation, $lang, array('r', $original), TP_CACHE_TTL); 
    244245 
    245246        logger("Exit: $translation/$original", 4); 
Note: See TracChangeset for help on using the changeset viewer.