0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
appartsoft.info
/
wp-content
/
plugins
/
content-mage
/
[
Home
]
File: GoogleTranslator.php
<?php class O3x { private $l35; private $l31; protected $O5h=array(); public function l3y($O13) { $this->l35 =$O13; return $this; } public function O3y($O5h) { $this->O5h =$O5h; return $this; } /** * Begins actual translation, before running this method you have to run * @see GoogleTranslator::setPath and @see GoogleTranslator::setInput() * first. * * @return GoogleTranslator */ public function l3z() { $O3t=count($this->O5h); if ($O3t<2 || strlen($this->l35) == 0) { $this->l31 =$this->l35; return $this; } $this->l31 =$this->l35; for ($O3=0; $O3<$O3t-1; $O3 ++) { $l5l=$this->O5h[$O3]; $O5l=$this->O5h[($O3+1)]; $this->l31 =$this->l5m($l5l,$O5l,$this->l31); } return $this; } private function l5m($l5l,$O5l,$O13) { $O3m=get_option('ContentMageOptions'); $O5m=$this->l5n(urlencode($O13)); $O5n=array(); $l5o=curl_multi_init(); foreach ($O5m as $l4e) { $url="h\164\164\160\072//aja\170\056\147ooglea\160\151\163\056com/a\152\141\170/serv\151\143es/la\156\147uage/"; $url.="translat\145\077\166=1.0&la\156\147\160air=".urlencode(strtolower($l5l)."\174".strtolower($O5l)); $url.="\046q=".$l4e; if ($O3m['googleAPI']) { $url.="&key=".$O3m['googleAPI']; } $O7=curl_init(); curl_setopt($O7,CURLOPT_URL,$url); curl_setopt($O7,CURLOPT_HEADER,0); curl_setopt($O7,CURLOPT_RETURNTRANSFER,TRUE); curl_setopt($O7,CURLOPT_CONNECTTIMEOUT,3); curl_setopt($O7,CURLOPT_TIMEOUT,8); curl_setopt($O7,CURLOPT_MAXREDIRS,012); if ($O3m['interfaceAddress'] != '') { curl_setopt($O7,CURLOPT_INTERFACE,trim($O3m['interfaceAddress'])); } $O5n[]=$O7; curl_multi_add_handle($l5o,$O5n[count($O5n)-1]); } $O57=microtime(TRUE); do { if (microtime(TRUE)-$O57>031) { throw new exception("I\164 tak\145\163 too \154\157ng t\157\040tran\163\154ate\040\164ext",-1); } curl_multi_exec($l5o,$O5o); } while ($O5o>0); $l5p=count($O5n); $l4h=""; for ($O3=0; $O3<$l5p; $O3 ++) { $l1r=curl_multi_getcontent($O5n[$O3]); $l1r=json_decode($l1r); if ($l1r->responseStatus == '403') { curl_multi_close($l5o); return $O13; } curl_multi_remove_handle($l5o,$O5n[$O3]); if (!$l1r instanceof stdclass) { throw new exception( "F\141\151\154\145\144 trans\154ating c\150\165\156\153\040$O3\040\146r\157m $l5l\040to $O5l."); } $l4h.= (string) $l1r->responseData->translatedText."\040"; } curl_multi_close($l5o); return ($l4h); } private function l5n($O13) { $O5m=array(); $O3k=""; foreach (explode("+",$O13) as $O5p) { $O3k.=$O5p."+"; if (strlen($O3k)>0310) { $O5m[]=$O3k; $O3k=""; } } $O5m[]=$O3k; return $O5m; } public function O3z() { return $this->l31; } } ?>