From dce608f5a4a33fb679c266c926efdaf4a084ba86 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 23 Feb 2010 18:32:00 +0000 Subject: #674784 by JohnAlbin, naxoc, et al: Fixed theme_get_suggestions() fails to return 'page__front()' suggestion on front page. --- includes/theme.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/theme.inc b/includes/theme.inc index 0c9b0c3ed..5d5363113 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -2460,20 +2460,22 @@ function theme_get_suggestions($args, $base, $delimiter = '__') { // page__node__edit page-node-edit $suggestions = array(); + $prefix = $base; foreach ($args as $arg) { // Remove slashes or null per SA-CORE-2009-003. $arg = str_replace(array("/", "\\", "\0"), '', $arg); // The percent acts as a wildcard for numeric arguments since // asterisks are not valid filename characters on many filesystems. if (is_numeric($arg)) { - $suggestions[] = $base . $delimiter . '%'; + $suggestions[] = $prefix . $delimiter . '%'; } - $suggestions[] = $base . $delimiter . $arg; + $suggestions[] = $prefix . $delimiter . $arg; if (!is_numeric($arg)) { - $base .= $delimiter . $arg; + $prefix .= $delimiter . $arg; } } if (drupal_is_front_page()) { + // Front templates should be based on root only, not prefixed arguments. $suggestions[] = $base . $delimiter . 'front'; } -- cgit v1.2.3