| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/geoplir/plugins/content/ |
Upload File : |
<?php
/**
* plugin_googlemap2_proxy.php,v 2.12 2008/07/29 13:34:11
* @copyright (C) Reumer.net
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
if (!isset($HTTP_RAW_POST_DATA)){
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
}
$post_data = $HTTP_RAW_POST_DATA;
$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($post_data);
$url = urldecode($_GET['url']);
$url = "http://".$url;
$ok = false;
if (ini_get('allow_url_fopen'))
if (($response = file_get_contents($url)))
$ok = true;
if (!$ok) {
$ch = curl_init( $url );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 80);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, 1);
if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
$response = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
$ok = true;
}
}
if (!$ok) {
$url = urldecode($_GET['url']);
// Do it the safe mode way for local files
$pattern = "/(www.)?".$_SERVER["HTTP_HOST"]."/i";
if (preg_match($pattern, $url)!=0) {
$url = $_SERVER["DOCUMENT_ROOT"].preg_replace($pattern, "", $url);
if (ini_get('allow_url_fopen'))
if (($response = file_get_contents($url)))
$ok = true;
if (!$ok) {
$ch = curl_init( $url );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 80);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, 1);
if ( strlen($post_data)>0 ){
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
$response = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
$ok = true;
}
}
}
}
if ($ok) {
while (@ob_end_clean());
header('content-type:text/xml;');
}
print $response;
?>