���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/public_html/easylive/index.php
���ѧ٧ѧ�
<?php error_reporting(E_ALL); /** Build a URL * * @param array $parts An array that follows the parse_url scheme * @return string */ function build_url($parts) { if (empty($parts['user'])) { $url = $parts['scheme'] . '://' . $parts['host']; } elseif(empty($parts['pass'])) { $url = $parts['scheme'] . '://' . $parts['user'] . '@' . $parts['host']; } else { $url = $parts['scheme'] . '://' . $parts['user'] . ':' . $parts['pass'] . '@' . $parts['host']; } if (!empty($parts['port'])) { $url .= ':' . $parts['port']; } if (!empty($parts['path'])) { $url .= $parts['path']; } if (!empty($parts['query'])) { $url .= '?' . $parts['query']; } if (!empty($parts['fragment'])) { return $url . '#' . $parts['fragment']; } return $url; } /** Convert a relative path in to an absolute path * * @param string $path * @return string */ function abs_path($path) { $path_array = explode('/', $path); // Solve current and parent folder navigation $translated_path_array = array(); $i = 0; foreach ($path_array as $name) { if ($name === '..') { unset($translated_path_array[--$i]); } elseif (!empty($name) && $name !== '.') { $translated_path_array[$i++] = $name; } } return '/' . implode('/', $translated_path_array); } /** Convert a relative URL in to an absolute URL * * @param string $url URL or URI * @param string $base Absolute URL * @return string */ function abs_url($url, $base) { $url_parts = parse_url($url); $base_parts = parse_url($base); // Handle the path if it is specified if (!empty($url_parts['path'])) { // Is the path relative if (substr($url_parts['path'], 0, 1) !== '/') { if (substr($base_parts['path'], -1) === '/') { $url_parts['path'] = $base_parts['path'] . $url_parts['path']; } else { $url_parts['path'] = dirname($base_parts['path']) . '/' . $url_parts['path']; } } // Make path absolute $url_parts['path'] = abs_path($url_parts['path']); } // Use the base URL to populate the unfilled components until a component is filled foreach (['scheme', 'host', 'path', 'query', 'fragment'] as $comp) { if (!empty($url_parts[$comp])) { break; } $url_parts[$comp] = $base_parts[$comp]; } return build_url($url_parts); } $curl_url = $_GET['url']; $curl = curl_init($curl_url); curl_setopt($curl, CURLOPT_URL, $curl_url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36", ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //for debug only! curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($curl); curl_close($curl); //var_dump($resp); $result = $resp; $rep_pattern = "/(?<=(?:(?<=src=')|(?<=href=')))(.*?)(?=\')/"; preg_match_all($rep_pattern, $result, $matches_st); $rep_pattern2 = '/(?<=(?:(?<=src=")|(?<=href=")))(.*?)(?=\")/'; preg_match_all($rep_pattern2, $result, $matches_du); $rep_pattern3 = '~<a(.*?)href="([^"]+)"(.*?)>~'; preg_match_all($rep_pattern3, $result, $matches_as); $rep_pattern4 = "~<a(.*?)href='([^']+)'(.*?)>~"; preg_match_all($rep_pattern4, $result, $matches_ad); //echo $result; //print_r($matches_st[0]); //print_r($matches_du[0]); //print_r($matches_as[2]); //print_r($matches_ad[2]); foreach ($matches_st[0] as &$valuest) { //echo abs_url($valuest, $curl_url); $result = str_replace($valuest, abs_url($valuest, $curl_url) . '#routed-by-easy-live', $result); } foreach ($matches_du[0] as &$valuedu) { //echo abs_url($valuedu, $curl_url); $result = str_replace($valuedu, abs_url($valuedu, $curl_url), $result); unset($valuedu); } /* foreach ($matches_as[2] as &$valueas) { //echo $valueas; $result = str_replace($valueas, 'https://rickard.co/easylive/?url=' . $valueas, $result); } foreach ($matches_ad[2] as &$valuead) { //echo $valuead; $result = str_replace($valuead, 'https://rickard.co/easylive/?url=' . $valuead, $result); } */ if(strlen($result) < 20) { echo "<html style='height: 100%;'></html><body style='width: 100%; min-height: 100%; height: 100%; margin: 0px; padding: 0px;'><div class='core' style='display: flex; justify-content: center; align-items: center; width: 100%; height: 100%;'><div class='error' style='padding: 15px; border-radius: 18px; background: #FBFBFD; box-shadow: inset 0 1px 0 rgb(255 255 255 / 60%), 0 22px 70px 4px rgb(0 0 0 / 56%), 0 0 0 1px rgb(0 0 0 / 0%); color: #000; font-family: arial; font-size: 15px; font-weight: bold; width: 400px; '>Easy Live has detected that this page may be unusually small. It's possible an error occured while attempting to render this page.</div></div></body></html>"; } else { echo "<!--\nTHIS PAGE IS ROUTED BY EASY LIVE\nA DIVISION OF THE RICKARD GROUP\n-->" . $result; } //echo abs_url("./style.css", $curl_url); /* // URL and URIs (_ is used to see what is coming from relative URL) $test_urls = array( "http://_example.com/_path1/_path2/_file.ext?_field1=_value1&_field2=_value2#_fragment", // URL "//_example.com/_path1/_path2/_file.ext?_field1=_value1&_field2=_value2#_fragment", // URI without scheme "//_example.com", // URI with host only "/_path1/_path2/_file.ext?_field1=_value1&_field2=_value2#_fragment", // URI without scheme and host "_path1/_path2/_file.ext", // URI with path only "./../../_path1/../_path2/file.ext#_fragment", // URI with path and fragment "?_field1=_value1&_field2=_value2#_fragment", // URI with query and fragment "#_fragment" // URI with fragment only ); // Expected result $expected_urls = array( "http://_example.com/_path1/_path2/_file.ext?_field1=_value1&_field2=_value2#_fragment", "https://_example.com/_path1/_path2/_file.ext?_field1=_value1&_field2=_value2#_fragment", "https://_example.com", "https://example.com/_path1/_path2/_file.ext?_field1=_value1&_field2=_value2#_fragment", "https://example.com/path1/path2/path3/path4/_path1/_path2/_file.ext", "https://example.com/path1/path2/_path2/file.ext#_fragment", "https://example.com/path1/path2/path3/path4/file.ext?_field1=_value1&_field2=_value2#_fragment", "https://example.com/path1/path2/path3/path4/file.ext?field1=value1&field2=value2#_fragment" ); foreach ($test_urls as $i => $url) { $abs_url = abs_url($url, $base_url); if ( $abs_url == $expected_urls[$i] ) { echo "[OK] " . $abs_url . PHP_EOL; } else { echo "[WRONG] " . $abs_url . PHP_EOL; } } */
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�