theme_location() shouldn't check for a fixed function name for the country-specific theming function, but ask the theming-system for a function.
This patch (also attached) does that:

diff --git a/location.inc b/location.inc
index 6a2cc67..ed3342a 100644
--- a/location.inc
+++ b/location.inc
@@ -116,9 +116,8 @@ function theme_location($location = array(), $hide = array()) {
   }
 
   $output = '';
-  $country_specific_function = 'theme_location_'. (isset($location['country']) ? $location['country'] : '');
-  if (function_exists($country_specific_function)) {
-    $output .= $country_specific_function($location, $hide);
+  if (isset($location['country']) && ($f = theme_get_function('location_'. $location['country']))) {
+    $output .= call_user_func($f, $location, $hide);
   }
   elseif (count($location)) {
     $output .= "\n";
CommentFileSizeAuthor
location-fix-theme_location-1.patch657 bytesray007

Comments

ankur’s picture

Status: Needs review » Fixed

This has been committed to the DRUPAL-5 branch. Thanks for the patch and noticing the disrespect towards the abstraction. Good catch... yo.

-Ankur

Anonymous’s picture

Status: Fixed » Closed (fixed)