com web/php: Hack to stop the manual/lang to manual/en/lang redirects for inactive langs, via help-translate.php: error.php

From: Date: Thu, 07 Apr 2011 15:19:04 +0000
Subject: com web/php: Hack to stop the manual/lang to manual/en/lang redirects for inactive langs, via help-translate.php: error.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-23560@lists.php.net to get a copy of this message
Commit: 36705da80b424dfedd284fdfefc26b99dc416650 Author: Philip Olson <philip@php.net> Thu, 7 Apr 2011 15:19:04 +0000 Parents: 9c12fb9788af4d922cd8b8ecff1e191e88f2dcbd Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=36705da80b424dfedd284fdfefc26b99dc416650 Log: Hack to stop the manual/lang to manual/en/lang redirects for inactive langs, via help-translate.php Changed paths: M error.php Diff: diff --git a/error.php b/error.php index c368f23..5e5cc78 100644 --- a/error.php +++ b/error.php @@ -14,6 +14,7 @@ // Ensure that our environment is set up include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/languages.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/errors.inc'; @@ -78,8 +79,11 @@ if (preg_match("!(.*\\.php)3$!", $URI, $array)) { // ============================================================================ // 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)) { - mirror_redirect("/manual/$LANG$array[1]"); +// @todo do we rely on this? how about removing it... +if (preg_match("!^manual/([^/]*)$!", $URI, $array)) { + if (!isset($INACTIVE_ONLINE_LANGUAGES[$array[1]])) { + mirror_redirect("/manual/$LANG/$array[1]"); + } } elseif (preg_match("!^manual/html/([^/]+)$!", $URI, $array)) { $array[1] = preg_replace("!.html$!", ".php", $array[1]); mirror_redirect("/manual/$LANG/$array[1]");

« previous php.webmaster (#23560) next »