com web/php: Fix Origin headers when browsing locally (e.g. using localhost): include/prepend.inc
| From: | Hannes Magnusson | Date: | Thu, 23 Jan 2014 00:34:28 +0000 |
| Subject: | com web/php: Fix Origin headers when browsing locally (e.g. using localhost): include/prepend.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18209@lists.php.net to get a copy of this message | ||
Commit: 03f249395e94cefcea8ff9d638b6a1a12fb7741e
Author: Hannes Magnusson <bjori@mongodb.com> Wed, 22 Jan 2014 16:34:28 -0800
Parents: 1a43ba3ce8bcf1df8e4d0b4ef6a8c74a23ef9837
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=03f249395e94cefcea8ff9d638b6a1a12fb7741e
Log:
Fix Origin headers when browsing locally (e.g. using localhost)
Changed paths:
M include/prepend.inc
Diff:
diff --git a/include/prepend.inc b/include/prepend.inc
index 04f040d..9abd550 100644
--- a/include/prepend.inc
+++ b/include/prepend.inc
@@ -16,7 +16,9 @@ header("Content-type: text/html; charset=utf-8");
if (isset($_SERVER["HTTP_ORIGIN"])) {
$host = parse_url($_SERVER["HTTP_ORIGIN"]);
if (strncmp(strrev($host["host"]), strrev("php.net"),
strlen("php.net")) != 0) {
- exit(10);
+ if ($host["host"] != $_SERVER["SERVER_NAME"]) {
+ exit(10);
+ }
}
if (isset($host["port"])) {
$hostname = $host["host"] . ":" . $host["port"];