Changeset 533


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

Fixed bugs noticed by Nicholas

Location:
trunk/WordPress/plugin/transposh
Files:
2 edited

Legend:

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

    r529 r533  
    134134        add_action('comment_post', array(&$this, 'add_comment_meta_settings'), 1); 
    135135        // comment_moderation_text - future filter TODO 
    136  
    137136        // full post wrapping (should happen late) 
    138137        add_filter('the_content', array(&$this, 'post_content_wrap'), 9999); 
     
    217216            logger('Translation completed in ' . ($end_time - $start_time) . ' seconds', 1); 
    218217        } 
    219   
     218 
    220219        return $buffer; 
    221220    } 
     
    433432 
    434433        // attempt to remove old files 
    435         @unlink($this->transposh_plugin_dir.'widgets/tpw_default.php'); 
    436         @unlink($this->transposh_plugin_dir.'core/globals.php'); 
     434        @unlink($this->transposh_plugin_dir . 'widgets/tpw_default.php'); 
     435        @unlink($this->transposh_plugin_dir . 'core/globals.php'); 
    437436 
    438437        logger("plugin_activate exit: " . dirname(__FILE__)); 
     
    619618        $use_params = FALSE; 
    620619        logger("got: $href", 5); 
     620        // fix what might be messed up 
     621        $href = str_replace(array(TP_GTXT_BRK, TP_GTXT_IBRK, TP_GTXT_BRK_CLOSER, TP_GTXT_IBRK_CLOSER), '', $href); 
    621622 
    622623        // Ignore urls not from this site 
  • 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.