com web/php: Fix undefined index warning and remove a commendedout code: ug.php
| From: | Hannes Magnusson | Date: | Mon, 31 Mar 2014 18:21:41 +0000 |
| Subject: | com web/php: Fix undefined index warning and remove a commendedout code: ug.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18646@lists.php.net to get a copy of this message | ||
Commit: 18ef3c5244f14d3ddac6a805a5d38ce308d1724c
Author: Hannes Magnusson <bjori@mongodb.com> Mon, 31 Mar 2014 11:21:41 -0700
Parents: 468b7365484650e84bb9322568b907cd7ddaa71a
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=18ef3c5244f14d3ddac6a805a5d38ce308d1724c
Log:
Fix undefined index warning and remove a commendedout code
Changed paths:
M ug.php
Diff:
diff --git a/ug.php b/ug.php
index 50103ac..8577a97 100644
--- a/ug.php
+++ b/ug.php
@@ -98,10 +98,10 @@ function print_ug_matches($matches) {
echo "</dl>";
}
-//$COUNTRY_ALPHA_2 = get_alpha2_country_from_alpha3($COUNTRY);
$country = isset($_GET["cc"]) ? $_GET["cc"] : $COUNTRY;
+$country_alpha_2 = isset($COUNTRY_ALPHA_3_TO_2[$country]) ? $COUNTRY_ALPHA_3_TO_2[$country] :
"NA";
$allcountries = array();
-$matches = get_usergroups_in($COUNTRY_ALPHA_3_TO_2[$country], $allcountries);
+$matches = get_usergroups_in($country_alpha_2, $allcountries);
if (isset($COUNTRIES[$country])) {
print_cc_header($country);
print_ug_matches($matches);