From 0094e99b8733b23a94cd0283909fae6e1dce8720 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Sun, 4 Sep 2005 13:13:31 +0000 Subject: [PATCH] - Patch #28576 by Robrecht Jacques: 'file' is a reserved variable. --- themes/engines/phptemplate/phptemplate.engine | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine index 366420fdd032..b58d9dcb9998 100644 --- a/themes/engines/phptemplate/phptemplate.engine +++ b/themes/engines/phptemplate/phptemplate.engine @@ -51,7 +51,7 @@ function phptemplate_regions() { * @return * The HTML generated by the template system. */ -function _phptemplate_callback($hook, $variables = array(), $file = null) { +function _phptemplate_callback($hook, $variables = array(), $file = NULL) { $variables = array_merge($variables, _phptemplate_default_variables($hook, $variables)); @@ -169,7 +169,7 @@ function phptemplate_page($content) { if ($sidebar_right != '') { $layout = ($layout == 'left') ? 'both' : 'right'; } - $sidebar_indicator = null; + $sidebar_indicator = NULL; // Construct page title if (drupal_get_title()) { @@ -310,7 +310,7 @@ function phptemplate_box($title, $content, $region = 'main') { * @param $file * A suggested template file to use. */ -function _phptemplate_default($hook, $variables, $file = null) { +function _phptemplate_default($hook, $variables, $file = NULL) { if ($file && file_exists(path_to_theme() . "/$file.tpl.php")) { $file = path_to_theme() . "/$file.tpl.php"; } @@ -324,13 +324,14 @@ function _phptemplate_default($hook, $variables, $file = null) { } else { $variables['hook'] = $hook; - watchdog('error', 'PHPTemplate was instructed to override the ' . $hook . ' theme function, but no valid template file was found.'); + watchdog('error', t('PHPTemplate was instructed to override the %name theme function, but no valid template file was found.', array('%name' => theme('placeholder', $hook)))); $file = 'themes/engines/phptemplate/default.tpl.php'; } } } if ($file) { + unset($variables['file']); // Make sure we don't override $file extract($variables); // Extract the vars to local namespace ob_start(); // Start output buffering include($file); // Include the file -- GitLab