diff --git a/core/includes/theme.inc b/core/includes/theme.inc index bcfb977..80e6144 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1291,10 +1291,10 @@ function drupal_find_theme_templates($cache, $extension, $path) { if (strpos($file->uri, str_replace($subtheme_paths, '', $file->uri)) !== 0) { continue; } - // Chop off the remaining '.tpl' extension. $template already has the - // rightmost extension removed, but there might still be more, such as with - // .tpl.php, which still has .tpl in $template at this point. - if (($pos = strpos($template, '.tpl')) !== FALSE) { + // Chop off the remaining extensions if there are any. $template already + // has the rightmost extension removed, but there might still be more, + // such as with .tpl.php, which still has .tpl in $template at this point. + if (($pos = strrpos($template, '.')) !== FALSE) { $template = substr($template, 0, $pos); } // Transform - in filenames to _ to match function naming scheme @@ -1341,7 +1341,7 @@ function drupal_find_theme_templates($cache, $extension, $path) { // already has the rightmost extension removed, but there might still // be more, such as with .tpl.php, which still has .tpl in $template // at this point. - if (($pos = strpos($match, '.')) !== FALSE) { + if (($pos = strrpos($match, '.')) !== FALSE) { $file = substr($match, 0, $pos); } // Put the underscores back in for the hook name and register this