cvs: phpweb / error.php

From: Date: Thu, 15 Jan 2004 12:59:42 +0000
Subject: cvs: phpweb / error.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-22974@lists.php.net to get a copy of this message
goba Thu Jan 15 07:59:42 2004 EDT Modified files: /phpweb error.php Log: distribute query string stripping and trailing slash stripping to where they will not cause problems for us (there are some handlers needing query strings and trailing slashes) Index: phpweb/error.php diff -u phpweb/error.php:1.18 phpweb/error.php:1.19 --- phpweb/error.php:1.18 Thu Dec 25 11:26:39 2003 +++ phpweb/error.php Thu Jan 15 07:59:42 2004 @@ -1,6 +1,6 @@ <?php -// $Id: error.php,v 1.18 2003/12/25 16:26:39 goba Exp $ +// $Id: error.php,v 1.19 2004/01/15 12:59:42 goba Exp $ /* @@ -17,11 +17,18 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc'; -// Get URI for this request (without the leading slash, and -// without any query string attached) +// Get URI for this request, strip leading slash // See langchooser.inc for more info on STRIPPED_URI -// Also decode special URL parts, eg %20 into a space $URI = substr($_SERVER['STRIPPED_URI'], 1); + +// ============================================================================ +// BC: handle bugs.php moved completely to bugs.php.net +if (preg_match("!^bugs.php?(.+)$!", $URI, $array)) { + mirror_redirect("http://bugs.php.net/?$array[1]"); +} + +// ============================================================================ +// Omit query string from URL and urldecode special chars $URI = urldecode(preg_replace("!(\\?.*$)!", "", $URI)); // ============================================================================ @@ -39,12 +46,6 @@ } // ============================================================================ -// BC: handle bugs.php moved completely to bugs.php.net -if (preg_match("!^bugs.php?(.+)$!", $URI, $array)) { - mirror_redirect("http://bugs.php.net/?$array[1]"); -} - -// ============================================================================ // BC: handle moving english manual down into its own directory (also supports // default language manual accessibilty on mirror sites through /manual/filename) if (preg_match("!^manual(/[^/]*)$!", $URI, $array)) { @@ -96,6 +97,10 @@ } // ============================================================================ +// The trailing slash only causes problems from now on +$URI = preg_replace('!/+$!', '', $URI); + +// ============================================================================ // Some nice URLs for getting something for download if (preg_match("!^get/([^/]+)$!", $URI, $what)) { switch ($what[1]) {

« previous php.mirrors (#22974) next »