com web/php: Remove the filename from BASE_HREF (used f or <base />), fixes bug#66138: include/shared-manual.inc include/site.inc

From: Date: Thu, 21 Nov 2013 17:29:29 +0000
Subject: com web/php: Remove the filename from BASE_HREF (used f or <base />), fixes bug#66138: include/shared-manual.inc include/site.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-17152@lists.php.net to get a copy of this message
Commit: cc3a7dccac0b1723b2778414aea89cde1c62e506 Author: Hannes Magnusson <bjori@mongodb.com> Thu, 21 Nov 2013 09:29:29 -0800 Parents: 58818349c746e9ca43330ebb246941ad5739ddce Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=cc3a7dccac0b1723b2778414aea89cde1c62e506 Log: Remove the filename from BASE_HREF (used for <base />), fixes bug#66138 Bugs: https://bugs.php.net/66138 Changed paths: M include/shared-manual.inc M include/site..inc Diff: diff --git a/include/shared-manual.inc b/include/shared-manual.inc index 1a78b01..c44d6de 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -335,8 +335,9 @@ function manual_setup($setup) { global $PGI, $MYSITE; $PGI = $setup; // Set base href for this manual page - $_SERVER['BASE_PAGE'] = 'manual/' . language_convert($setup['head'][1]) . "/" . $setup['this'][0]; - $_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE']; + $dirname = 'manual/' . language_convert($setup['head'][1]); + $_SERVER['BASE_PAGE'] = $dirname . "/" . $setup['this'][0]; + $_SERVER['BASE_HREF'] = $MYSITE . $dirname . "/"; $siblings = array(); diff --git a/include/site.inc b/include/site.inc index c930534..3137fc8 100644 --- a/include/site.inc +++ b/include/site.inc @@ -553,6 +553,7 @@ 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'])) { - $_SERVER['BASE_HREF'] = $MYSITE . $_SERVER['BASE_PAGE']; + $dirname = dirname($_SERVER['BASE_PAGE']); + $_SERVER['BASE_HREF'] = $MYSITE . $dirname .. "/"; } else { unset($_SERVER['BASE_HREF']); }

« previous php.webmaster (#17152) next »