? theme.inc.patch
Index: theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.627
diff -u -p -r1.627 theme.inc
--- theme.inc	3 Jan 2011 08:02:11 -0000	1.627
+++ theme.inc	24 Jan 2011 22:17:09 -0000
@@ -963,7 +963,6 @@ function path_to_theme() {
 function drupal_find_theme_functions($cache, $prefixes) {
   $implementations = array();
   $functions = get_defined_functions();
-
   foreach ($cache as $hook => $info) {
     foreach ($prefixes as $prefix) {
       // Find theme functions that implement possible "suggestion" variants of
@@ -982,7 +981,7 @@ function drupal_find_theme_functions($ca
         $matches = preg_grep('/^' . $prefix . '_' . $pattern . '/', $functions['user']);
         if ($matches) {
           foreach ($matches as $match) {
-            $new_hook = str_replace($prefix . '_', '', $match);
+            $new_hook = preg_replace("/^" . $prefix . "_/", "", $match);
             $arg_name = isset($info['variables']) ? 'variables' : 'render element';
             $implementations[$new_hook] = array(
               'function' => $match,
