Skip to content
Snippets Groups Projects
Commit 0094e99b authored by Dries Buytaert's avatar Dries Buytaert
Browse files

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

parent c13025d2
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -51,7 +51,7 @@ function phptemplate_regions() { ...@@ -51,7 +51,7 @@ function phptemplate_regions() {
* @return * @return
* The HTML generated by the template system. * 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)); $variables = array_merge($variables, _phptemplate_default_variables($hook, $variables));
...@@ -169,7 +169,7 @@ function phptemplate_page($content) { ...@@ -169,7 +169,7 @@ function phptemplate_page($content) {
if ($sidebar_right != '') { if ($sidebar_right != '') {
$layout = ($layout == 'left') ? 'both' : 'right'; $layout = ($layout == 'left') ? 'both' : 'right';
} }
$sidebar_indicator = null; $sidebar_indicator = NULL;
// Construct page title // Construct page title
if (drupal_get_title()) { if (drupal_get_title()) {
...@@ -310,7 +310,7 @@ function phptemplate_box($title, $content, $region = 'main') { ...@@ -310,7 +310,7 @@ function phptemplate_box($title, $content, $region = 'main') {
* @param $file * @param $file
* A suggested template file to use. * 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")) { if ($file && file_exists(path_to_theme() . "/$file.tpl.php")) {
$file = path_to_theme() . "/$file.tpl.php"; $file = path_to_theme() . "/$file.tpl.php";
} }
...@@ -324,13 +324,14 @@ function _phptemplate_default($hook, $variables, $file = null) { ...@@ -324,13 +324,14 @@ function _phptemplate_default($hook, $variables, $file = null) {
} }
else { else {
$variables['hook'] = $hook; $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'; $file = 'themes/engines/phptemplate/default.tpl.php';
} }
} }
} }
if ($file) { if ($file) {
unset($variables['file']); // Make sure we don't override $file
extract($variables); // Extract the vars to local namespace extract($variables); // Extract the vars to local namespace
ob_start(); // Start output buffering ob_start(); // Start output buffering
include($file); // Include the file include($file); // Include the file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment