Re: com web/php: move $URI.php test higher up in error.php (phpweb bug #67871): error.php

From: Date: Wed, 20 Aug 2014 21:05:30 +0000
Subject: Re: com web/php: move $URI.php test higher up in error.php (phpweb bug #67871): error.php
References: 1  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-19735@lists.php.net to get a copy of this message
On 20 August 2014 22:03, Peter Cowburn <salathe@php.net> wrote: > Commit: 1f4a628d844aec530de87aa8c574ce00d3aeb48a > Author: Peter Cowburn <salathe@php.net> Wed, 20 Aug 2014 > 22:03:39 +0100 > Parents: 3ca803e13aaff7e9cdff5469e947cc017f50a5a2 > Branches: master > > Link: > > http://git.php.net/?p=web/php.git;a=commitdiff;h=1f4a628d844aec530de87aa8c574ce00d3aeb48a > > Log: > move $URI.php test higher up in error.php (phpweb bug #67871) > > This test was below (way below) the $URI = strtolower($URI) line, so > when browsing to /manual/pt_BR/function.strpos we were looking for > /manual/pt_br/function.strpos.php which doesn't exist (on case-sensitive > filesystems). > > Note: This is a quick fix... if it causes (significant) issues, we might > have to think of a more involved solution than shuffling the code up the > file by a few hundred lines. > > Bugs: > https://bugs.php.net/67871 > > Changed paths: > M error.php > > > Diff: > diff --git a/error.php b/error.php > index 4a9ef61..2931155 100644 > --- a/error.php > +++ b/error.php > @@ -189,6 +189,17 @@ if > (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) { > if (is_numeric($URI)) { > mirror_redirect("http://bugs.php.net/bug.php?id=$URI"XïØÛ÷îÀô > o?B?n); > } > + > +// > ============================================================================ > +// Redirect if the entered URI was a PHP page name (except some pages, > +// which we display in the mirror's language or the explicitly specified > +// language [see below]) > +if (!in_array($URI, array('mirror-info', 'error', 'mod')) > && > + file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) { > + echo($_SERVER['DOCUMENT_ROOT'] . "/$URI.php"); > +exit; > Yes, I’m an idiot! > + mirror_redirect("/$URI.php"); > +} > > // Work with lowercased URI from now > $URI = strtolower($URI); > @@ -486,15 +497,6 @@ if (isset($uri_aliases[$URI])) { > } > > // > ============================================================================ > -// Redirect if the entered URI was a PHP page name (except some pages, > -// which we display in the mirror's language or the explicitly specified > -// language [see below]) > -if (!in_array($URI, array('mirror-info', 'error', 'mod')) > && > - file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) { > - mirror_redirect("/$URI.php"); > -} > - > -// > ============================================================================ > // Execute external redirect if a rule exists for the URI > if (isset($external_redirects[$URI])) { > mirror_redirect($external_redirects[$URI]); > > > -- > PHP Webmaster List Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.webmaster (#19735) next »