Skip to content

Commit 895cc03

Browse files
authored
Update index.php
1 parent 10c91d5 commit 895cc03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

assets/php/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,9 @@ function get_client_address() {
662662
if ($result['success']) {
663663
$response = str_replace(RELAY_PROXY_PASS, sprintf("%s://%s", $_SERVER['REQUEST_SCHEME'], $_SERVER['HTTP_HOST']), $result['result']['data']);
664664
if (RELAY_ENABLE_JS_REDIRECT) {
665-
$response .= "<script>setTimeout(function() { var a = document.createElement('a'); a.href = '" . $proxy_url . "'; document.body.appendChild(a); a.click(); }, 3000);</script>";
665+
if (strpos(strtolower(trim(substr($response, 0, 16))), "<!doctype html") === 0) {
666+
$response .= "<script>setTimeout(function() { var a = document.createElement('a'); a.href = '" . $proxy_url . "'; document.body.appendChild(a); a.click(); }, 3000);</script>";
667+
}
666668
}
667669
exit($response);
668670
} else {

0 commit comments

Comments
 (0)