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']); } /**