1
0
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:
Derick Rethans
2026-03-23 11:08:11 +00:00
parent dc26a872ee
commit a46c652c32

View File

@@ -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);
}