Commit 0094e99b authored by Dries's avatar Dries
Browse files

- Patch #28576 by Robrecht Jacques: 'file' is a reserved variable.

parent c13025d2
......@@ -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
......
Markdown is supported
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