Ignore:
Timestamp:
08/26/2010 01:57:15 AM (21 months ago)
Author:
ofer
Message:

Fixes for fetch_original

File:
1 edited

Legend:

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

    r512 r519  
    110110 
    111111        // remove the language from the url permalink (if in start of path, and is a defined language) 
     112        $gluebackhome = false; 
    112113        $home_path = rtrim(parse_url($home_url, PHP_URL_PATH), "/"); 
    113114        logger("home: $home_path " . $parsedurl['path'], 5); 
     
    134135        //$params =""; 
    135136        if ($is_edit) { 
    136             $params[edit] = EDIT_PARAM . '=1'; 
     137            $params['edit'] = EDIT_PARAM . '=1'; 
    137138        } 
    138139 
     
    252253     */ 
    253254    public static function translate_url($href, $home_url, $target_language, $fetch_translation_func) { 
     255        $url=''; 
     256        $querypart=''; 
    254257        // todo - check query part... sanitize 
    255258        if (strpos($href, '?') !== false) { 
     
    261264        foreach ($parts as $part) { 
    262265            if (!$part) continue; 
    263             list($translated_text, $old_source) = call_user_func_array($fetch_translation_func, array($part, $target_language)); 
     266            list($source, $translated_text) = call_user_func_array($fetch_translation_func, array($part, $target_language)); 
    264267            if ($translated_text) 
    265268                    $url .= '/' . str_replace(' ', '-', $translated_text); 
    266269            else { 
    267270                // now the same attempt with '-' replaced to ' ' 
    268                 list($translated_text, $old_source) = call_user_func_array($fetch_translation_func, array(str_replace('-', ' ', $part), $target_language)); 
     271                list($source, $translated_text) = call_user_func_array($fetch_translation_func, array(str_replace('-', ' ', $part), $target_language)); 
    269272                //logger ($part. ' '.str_replace('-', ' ', $part).' '.$translated_text); 
    270273                if ($translated_text) 
     
    289292        $url = urldecode($href); 
    290293        $url = (($pos = strpos($url, '?')) ? substr($url, 0, $pos) : $url); 
     294        $url2 =''; 
    291295        $parts = explode('/', $url); 
    292296        foreach ($parts as $part) { 
Note: See TracChangeset for help on using the changeset viewer.