Changeset 669


Ignore:
Timestamp:
11/21/2011 02:44:44 PM (6 months ago)
Author:
ofer
Message:

Fixed minor issues with the transposh google and google suggest proxies

File:
1 edited

Legend:

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

    r667 r669  
    12061206        $sl = 'auto'; 
    12071207        if (isset($_GET['sl'])) $sl = $_GET['sl']; 
    1208         $q = '&q=' . urlencode($_GET['q']); 
    1209         $url = 'http://translate.google.com/translate_a/t?client=a' . $q . '&tl=' . $tl . '&sl=' . $sl; 
    1210         //var_dump($url); 
     1208        $q = @urlencode($_GET['q']); 
     1209        if (!$q) return; // avoid unneeded curling 
     1210        $url = 'http://translate.google.com/translate_a/t?client=a&q=' . $q . '&tl=' . $tl . '&sl=' . $sl; 
    12111211        $ch = curl_init(); 
    12121212        curl_setopt($ch, CURLOPT_URL, $url); 
     
    13131313                    $jsonout->results[] = $jsonarr->results[$k]->sentences[0]->trans; 
    13141314                } else { 
    1315                     $jsonout->results[] = $_GET['q' . $j]; 
     1315                    $jsonout->results[] = $_GET['q'][$j]; 
    13161316                } 
    13171317                $k++; 
Note: See TracChangeset for help on using the changeset viewer.