Skip to content

Commit a46c652

Browse files
committed
Fixed host suffix check
1 parent dc26a87 commit a46c652

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/prepend.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ header("Permissions-Policy: interest-cohort=()");
2626
}
2727

2828
$host = parse_url($_SERVER["HTTP_ORIGIN"]);
29-
if (strncmp(strrev($host["host"]), strrev("php.net"), strlen("php.net")) != 0) {
29+
if (!preg_match('/^(.+\.)?php\.net$/', $host["host"])) {
3030
if ($host["host"] != $_SERVER["SERVER_NAME"]) {
3131
exit(10);
3232
}

0 commit comments

Comments
 (0)