blob: 9c2e733a998dad8e7e64f3f73c7d04d462664b5b [file] [log] [blame]
<?php
#*****************************************************************************
#
# en_mir_list.php
#
# Author: Denis Roy
# Date: 2004-11-20
#
# Description: UI to list mirrors in XML format
#
# HISTORY:
# - 2004-11-25: removed the <mirrors> and </mirrors> markers because platform
# team did not want well-formed xml
# - 2006-07-07: David Williams
# Mirrors list not displayed with some VM's, due to parsing quirk
# with non-UTF-8 streams on old crimson parsers.
# See https://bugs.eclipse.org/bugs/show_bug.cgi?id=149771
#
#****************************************************************************
#include("inc/en_doc_header.php");
#include("inc/en_banner.php");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<mirrors>\n";
?>
<?php
while ($myrow = mysql_fetch_assoc($rs)) {
$path = $myrow['base_path'];
$path .= getPath($myrow['drop_id'], $_drop_id, $myrow['rel_path_override'], $myrow['our_path'], $myrow['our_path2']);
// To work around bug documented in https://bugs.eclipse.org/bugs/show_bug.cgi?id=149771
// we want to "send" UTF-8 encoding. And, we know we are encoded on eclipse.org as ISO-8859-1, so,
// we just convert the NL sensitive parts (spaces, brackets, protocols, etc., would be same in either.
$rawPath = $path;
$utfPath = mb_convert_encoding($rawPath, "UTF-8", "ISO-8859-1");
$rawCountry = $myrow['country_desc'];
$utfCountry = mb_convert_encoding($rawCountry, "UTF-8", "ISO-8859-1");
$rawOrg = str_replace("&", "&amp;", $myrow['organization']);
$utfOrg = mb_convert_encoding($rawOrg, "UTF-8", "ISO-8859-1");
?>
<mirror url="<?= $utfPath ?>" label="[<?= $utfCountry ?>] <?= $utfOrg ?> (<?= $myrow['protocol'] ?>)" />
<?php
}
echo "</mirrors>\n";
?>