cvs: phpweb /include site.inc

From: Date: Tue, 14 May 2002 21:36:45 +0000
Subject: cvs: phpweb /include site.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-10178@lists.php.net to get a copy of this message
goba Tue May 14 17:36:45 2002 EDT Modified files: /phpweb/include site.inc Log: Add some more logic to autoselection code (this is picky on www.php.net for example, as it has many names) Index: phpweb/include/site.inc diff -u phpweb/include/site.inc:1.219 phpweb/include/site.inc:1.220 --- phpweb/include/site.inc:1.219 Sun Mar 3 14:15:17 2002 +++ phpweb/include/site.inc Tue May 14 17:36:45 2002 @@ -48,10 +48,13 @@ } function show_mirror_options ($current) { - global $MIRRORS, $COUNTRIES; + global $MIRRORS, $COUNTRIES, $REQUEST_URI; foreach ($MIRRORS as $url=>$mirror) { if ($mirror[4] == 1) { /* only list full mirrors here */ - if ($url==$current) { + // If this is the current one, or the REQUEST_URI starts with the URL + // (the server provides a different name as it's name then what is + // used to access it} => selected it by default + if ($url == $current || preg_match("!^$url!", $REQUEST_URI) { echo '<option value="' . $url . '" selected>' . $COUNTRIES[$mirror[0]] . ' (' . $mirror[1] . ") *</option>\n"; } else {

« previous php.mirrors (#10178) next »