mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Fixed host suffix check
This commit is contained in:
@@ -26,7 +26,7 @@ header("Permissions-Policy: interest-cohort=()");
|
||||
}
|
||||
|
||||
$host = parse_url($_SERVER["HTTP_ORIGIN"]);
|
||||
if (strncmp(strrev($host["host"]), strrev("php.net"), strlen("php.net")) != 0) {
|
||||
if (!preg_match('/^(.+\.)?php\.net$/', $host["host"])) {
|
||||
if ($host["host"] != $_SERVER["SERVER_NAME"]) {
|
||||
exit(10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user