uawdijnntqw1x1x1
IP : 3.137.159.13
Hostname : ns1.eurodns.top
Kernel : Linux ns1.eurodns.top 4.18.0-553.5.1.lve.1.el7h.x86_64 #1 SMP Fri Jun 14 14:24:52 UTC 2024 x86_64
Disable Function : mail,sendmail,exec,passthru,shell_exec,system,popen,curl_multi_exec,show_source,eval,open_base
OS : Linux
PATH:
/
home
/
sudancam
/
public_html
/
0d544
/
..
/
shop
/
..
/
wp-content
/
plugins
/
wp-automatic
/
.
/
inc
/
translator.Yandex.php
/
/
<?php /** * Class:Translator to translate using Yandex * @author Atef (sweetheatmn@gmail.com) * @version 1.0.0 */ class YandexTranslator{ public $ch; //curl handler to use public $key; /** * Constructor to recieve curl handler * @param curl $ch */ function __construct(&$ch,$key){ $this->ch = $ch; $this->key = $key; } /** * Translate text using Google Post request to google translate * @param unknown $sourceText * @param unknown $fromLanguage * @param unknown $toLanguage * @return string translated text */ function translateText($sourceText , $fromLanguage ,$toLanguage){ //translating $x='error'; $curlurl='https://translate.yandex.net/api/v1.5/tr.json/translate?key='.trim($this->key).'&lang='.trim($fromLanguage).'-'.trim($toLanguage); $curlurl = str_replace('auto-','' , $curlurl); $curlpost= "text=" . urlencode($sourceText) ; curl_setopt($this->ch, CURLOPT_URL, $curlurl); curl_setopt($this->ch, CURLOPT_POST, true); curl_setopt($this->ch, CURLOPT_POSTFIELDS, $curlpost); $x='error'; $exec=curl_exec($this->ch); $x=curl_error($this->ch); // Empty response check if(trim($exec) == ''){ throw new Exception('Empty translator reply with possible curl error '.$x); } // Validate JSON {" if( ! stristr($exec, '{"') ){ throw new Exception('No JSON was returned, unexpected reply from Yandex' . $exec); } //json decode $json_reply = json_decode($exec); //validate JSON if( ! isset($json_reply->code)){ throw new Exception('No code was found in JSON , unexpected reply from Yandex' . $exec); } $code = $json_reply->code; if($code != 200){ throw new Exception('Yandex error ' . $json_reply->message); } $translated_array = $json_reply->text; if ( trim($translated_array[0]) == ''){ throw new Exception('Can not extract returned translation' ); } return $translated_array[0] ; } }
/home/sudancam/public_html/0d544/../shop/../wp-content/plugins/wp-automatic/./inc/translator.Yandex.php