cvs: phpweb /include langchooser.inc

From: Date: Wed, 04 Jun 2003 08:18:37 +0000
Subject: cvs: phpweb /include langchooser.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-18486@lists.php.net to get a copy of this message
goba Wed Jun 4 04:18:37 2003 EDT Modified files: /phpweb/include langchooser.inc Log: Also set the explicit lang if it was specified in a shortcut (eg. /hu/echo) as we include the page now, and don't redirect Index: phpweb/include/langchooser.inc diff -u phpweb/include/langchooser.inc:1.28 phpweb/include/langchooser.inc:1.29 --- phpweb/include/langchooser.inc:1.28 Tue May 27 12:40:05 2003 +++ phpweb/include/langchooser.inc Wed Jun 4 04:18:37 2003 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: langchooser.inc,v 1.28 2003/05/27 16:40:05 goba Exp $ +// $Id: langchooser.inc,v 1.29 2003/06/04 08:18:37 goba Exp $ /* @@ -61,19 +61,23 @@ if (preg_match("!^/(\\w{2}(_\\w{2})?)/!", $_SERVER['REQUEST_URI'], $flang)) { // Put language into preference list - language_add($flang[1], $languages); + $flang = language_add($flang[1], $languages); + + // Set explicity specified language + if (empty($explicitly_specified)) { + $explicitly_specified = $flang; + } // Drop out langauge specification from URL, as this is already handled $_SERVER['STRIPPED_URI'] = preg_replace( "!^/$flang[1]/!", "/", $_SERVER['REQUEST_URI'] ); - - // No need to set $explicitly_specified here, as no page will - // be displayed, only a Location header is sent back to the user. + } // Specified in a manual URL (eg. manual/en/ or manual/pt_br/) if (preg_match("!^/manual/(\\w{2}(_\\w{2})?)(/|$)!", $_SERVER['REQUEST_URI'], $flang)) { + $flang = language_add($flang[1], $languages); // Set explicity specified language

« previous php.mirrors (#18486) next »