diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-23 09:42:09 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-10-23 09:42:09 +0000 |
commit | bb9bae4d979bf04f9e99c2a2ea36e6961464defe (patch) | |
tree | cda66a487f1cf76ef1d61935c5f528bc82caf60d /includes | |
parent | 296f6e9f1166d8623c1d9ed37dc55dbbdc02f5be (diff) | |
download | brdo-bb9bae4d979bf04f9e99c2a2ea36e6961464defe.tar.gz brdo-bb9bae4d979bf04f9e99c2a2ea36e6961464defe.tar.bz2 |
#184876 by dijnz, merlinofchaos and myself: non-phptemplate files were not discovered - implement proper extension chopping
Diffstat (limited to 'includes')
-rw-r--r-- | includes/theme.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 621b9e77d..258e7673a 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, '-', '_'); |