aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-01-21 00:51:36 +0100
committerAndreas Fischer <bantu@phpbb.com>2015-01-21 01:02:16 +0100
commite34b92882a51dc89da88464b8c751a9d93a03124 (patch)
tree3d69a230cfc20414a88c154fc97d0031c224ca71
parent4b9434bf1ba4c015da11309602cfccf1a9c2493c (diff)
downloadforums-e34b92882a51dc89da88464b8c751a9d93a03124.tar
forums-e34b92882a51dc89da88464b8c751a9d93a03124.tar.gz
forums-e34b92882a51dc89da88464b8c751a9d93a03124.tar.bz2
forums-e34b92882a51dc89da88464b8c751a9d93a03124.tar.xz
forums-e34b92882a51dc89da88464b8c751a9d93a03124.zip
[ticket/13531] Send 404 Not Found.
PHPBB3-13531
-rw-r--r--phpBB/includes/startup.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index d9dab2a356..92639fc5bd 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -126,7 +126,21 @@ function phpbb_has_trailing_path($phpEx)
// Check if trailing path is used
if (phpbb_has_trailing_path($phpEx))
{
- exit('Trailing paths and path_info is not supported by phpBB 3.0');
+ if (substr(strtolower(@php_sapi_name()), 0, 3) === 'cgi')
+ {
+ $prefix = 'Status:';
+ }
+ else if (!empty($_SERVER['SERVER_PROTOCOL']))
+ {
+ $prefix = $_SERVER['SERVER_PROTOCOL'];
+ }
+ else
+ {
+ $prefix = 'HTTP/1.0';
+ }
+ header("$prefix 404 Not Found", true, 404);
+ echo 'Trailing paths and PATH_INFO is not supported by phpBB 3.0';
+ exit;
}
// Register globals and magic quotes have been dropped in PHP 5.4