com web/php: Fix Origin headers when browsing locally (e.g. using localhost): include/prepend.inc
| From: | Paul Dragoonis | 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-22205@lists.php.net to get a copy of this message | ||
Commit: 0416c61fba401f99ed9583e86864990828479165
Author: Hannes Magnusson <bjori@mongodb.com> Wed, 22 Jan 2014 16:34:28 -0800
Parents: 90e0a492567fa55d9038dc4ff0d7fb0989db674f
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=0416c61fba401f99ed9583e86864990828479165
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"];