Commit bb9bae4d authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#184876 by dijnz, merlinofchaos and myself: non-phptemplate files were not...

#184876 by dijnz, merlinofchaos and myself: non-phptemplate files were not discovered - implement proper extension chopping
parent 296f6e9f
......@@ -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, '-', '_');
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment