From 077bb151ade45fe9ebe640c14646f0bab844e4d3 Mon Sep 17 00:00:00 2001 From: messju Date: Sat, 27 Dec 2003 09:41:43 +0000 Subject: [PATCH] made $SCRIPT_NAME available again changes default for request_use_auto_global to prefer autoglobals --- NEWS | 3 +++ libs/Smarty.class.php | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ad0f29b8..bc6a4cb1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ + - change default of request_use_auto_globals to true - $_SERVER is + now preferred over $HTTP_SERVER_VARS (messju) + - re-add support for $SCRIPT_NAME (messju) - reactivate $smarty->default_modifiers (messju) - add cookie persistance to debug console (Monte) - allow single-digit days and months without smarty_make_timestamp() diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 2f2bbe38..0b5c50b5 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -287,7 +287,7 @@ class Smarty * * @var boolean */ - var $request_use_auto_globals = false; + var $request_use_auto_globals = true; /** * Set this if you want different sets of compiled files for the same @@ -583,6 +583,8 @@ class Smarty */ function Smarty() { + $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] + : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); } /**