diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 6432e903..5c105106 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1142,7 +1142,7 @@ class Smarty ? $this->tpl_error_reporting : error_reporting() & ~E_NOTICE); if (!$this->debugging && $this->debugging_ctrl == 'URL' - && @strstr($GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'], $this->_smarty_debug_id)) { + && @strstr(($this->request_use_auto_globals) ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'], $this->_smarty_debug_id)) { // enable debugging from URL $this->debugging = true; } @@ -1204,7 +1204,8 @@ class Smarty $_smarty_results .= smarty_core_display_debug_console($_params, $this); } if ($this->cache_modified_check) { - $_last_modified_date = @substr($GLOBALS['HTTP_SERVER_VARS']['HTTP_IF_MODIFIED_SINCE'], 0, strpos($GLOBALS['HTTP_SERVER_VARS']['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); + $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT'; if (@count($this->_cache_info['insert_tags']) == 0 && !$this->_cache_serials diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php index 2fcdb4e1..3fe5f97a 100644 --- a/libs/plugins/function.html_image.php +++ b/libs/plugins/function.html_image.php @@ -46,9 +46,9 @@ function smarty_function_html_image($params, &$smarty) $extra = ''; $prefix = ''; $suffix = ''; - $basedir = isset($GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']) - ? $GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT'] : ''; - if(strstr($GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'], 'Mac')) { + $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; + if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) { $dpi_default = 72; } else { $dpi_default = 96;