PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/live2news.com/wp-content/plugins/wp-automatic/inc/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/live2news.com/wp-content/plugins/wp-automatic/inc/proxy.GoogleTranslate.php

<?php


class GoogleTranslateProxy{
	
	public $ch;
	
	/**
	 * 
	 * @param curl handler $ch
	 */
	function __construct(&$ch){
		$this->ch = $ch;
	}	
	
	
	function fetch($url){
		
		$url = "https://translate.google.com/translate?hl=en&ie=UTF8&prev=_t&sl=ar&tl=en&u=".urlencode($url);
		
		 
		
  		// Translate a url
		curl_setopt($this->ch, CURLOPT_HTTPGET, 1);
		curl_setopt($this->ch, CURLOPT_URL, wp_automatic_trim($url));
		
		$exec=curl_exec($this->ch);
		$x=curl_error($this->ch);
		 
		
		// validate final content 
		if(wp_automatic_trim($exec) == ''){
			throw new Exception('_c url returned empty response');
		}
		
		
		
		// clean content 
		$exec = preg_replace('{<span class="google-src-text.*?>.*?</span>}', "", $exec);
		$exec = preg_replace('{<span class="notranslate.*?>(.*?)</span>}', "$1", $exec);
		$exec = wp_automatic_str_replace(' style=";text-align:left;direction:ltr"', '', $exec);
		
		 	
		
		// Return result
		return $exec;
		
	}
	
	
}