com web/php: Un-taint the base tag with "./" things :): include/site.inc
| From: | Paul Dragoonis | Date: | Thu, 21 Nov 2013 18:00:58 +0000 |
| Subject: | com web/php: Un-taint the base tag with "./" things :): include/site.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-22486@lists.php.net to get a copy of this message | ||
Commit: 782788e0d0ad0149827a64663b311abe879604d4
Author: Hannes Magnusson <bjori@mongodb.com> Thu, 21 Nov 2013 10:00:58 -0800
Parents: 62086b0b0fd0b72d512f2783c58fdafaca975d58
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=782788e0d0ad0149827a64663b311abe879604d4
Log:
Un-taint the base tag with "./" things :)
Changed paths:
M include/site.inc
Diff:
diff --git a/include/site.inc b/include/site.inc
index 3137fc8..1639ddd 100644
--- a/include/site.inc
+++ b/include/site.inc
@@ -553,7 +553,10 @@ if (isset($_SERVER['MIRROR_STATS'])) {
// Provide base href information to make relative links on
// shortcut URL accessed pages work without redirection
if (isset($_SERVER['BASE_PAGE'])) {
- $dirname = dirname($_SERVER['BASE_PAGE']);
- $_SERVER['BASE_HREF'] = $MYSITE . $dirname . "/";
+ $dirname = dirname($_SERVER['BASE_PAGE']) . "/";
+ if ($dirname == "./") {
+ $dirname = "";
+ }
+ $_SERVER['BASE_HREF'] = $MYSITE . $dirname;
} else { unset($_SERVER['BASE_HREF']); }