Commit:    c7cdf751580bbb796e6772b58cefc4334690d64a
Author:    Hannes Magnusson <[email protected]>         Fri, 22 Nov 2013 
00:48:56 -0800
Parents:   1d2a2e9ef64493c102768296907b3eaf2860728f
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=c7cdf751580bbb796e6772b58cefc4334690d64a

Log:
Maybe some mirrors are using symlinks for the docroot, thats why its failing?

Changed paths:
  M  cached.php


Diff:
diff --git a/cached.php b/cached.php
index 0de9e2d..3d6305b 100644
--- a/cached.php
+++ b/cached.php
@@ -6,11 +6,12 @@ if (!isset($_GET["f"])) {
     header("Location: http://php.net/";);
     exit;
 }
-$abs = $_SERVER["DOCUMENT_ROOT"]. "/" .(string)$_GET["f"];
+$pwd = realpath($_SERVER["DOCUMENT_ROOT"]);
+$abs = $pwd. "/" .(string)$_GET["f"];
 $abs = realpath($abs);
 
-if (strncmp($abs, $_SERVER["DOCUMENT_ROOT"], 
strlen($_SERVER["DOCUMENT_ROOT"])) != 0) {
-    header("Location: http://php.net";);
+if (strncmp($abs, $pwd, strlen($pwd)) != 0) {
+    header("Location: http://php.net/$abs";);
     exit;
 }


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to