summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2007-10-23 09:42:09 (GMT)
committerGábor Hojtsy2007-10-23 09:42:09 (GMT)
commitbb9bae4d979bf04f9e99c2a2ea36e6961464defe (patch)
treecda66a487f1cf76ef1d61935c5f528bc82caf60d
parent296f6e9f1166d8623c1d9ed37dc55dbbdc02f5be (diff)
#184876 by dijnz, merlinofchaos and myself: non-phptemplate files were not discovered - implement proper extension chopping
-rw-r--r--includes/theme.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 621b9e7..258e767 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -766,10 +766,12 @@ function drupal_find_theme_templates($cache, $extension, $path) {
// templates separately from checking for patterns.
$files = drupal_system_listing($regex, $path, 'name', 0);
foreach ($files as $template => $file) {
- // Chop off the extension. We do it this way because $template will
- // have one extension chopped off, but there might be more than one,
- // such as with .tpl.php
- $template = substr($template, 0, strpos($template, '.'));
+ // 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 = strpos($template, '.')) !== FALSE) {
+ $template = substr($template, 0, $pos);
+ }
// Transform - in filenames to _ to match function naming scheme
// for the purposes of searching.
$hook = strtr($template, '-', '_');