Re: [SMARTY] SERVER_NAME

From: Date: Fri, 06 Jun 2003 22:14:16 +0000
Subject: Re: [SMARTY] SERVER_NAME
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9672@lists.php.net to get a copy of this message
On Wed, 2003-06-04 at 01:36, steve wrote: > I downloaded the last CVS version,and I notice that in the > Smarty_Compiler.class.php, we have: > case 'get': > $compiled_ref = "\$GLOBALS['HTTP_GET_VARS']"; > break; > > case 'post': > $compiled_ref = "\$GLOBALS['HTTP_POST_VARS']"; > break; > > case 'cookies': > $compiled_ref = "\$GLOBALS['HTTP_COOKIE_VARS']"; > break; > > case 'env': > $compiled_ref = "\$GLOBALS['HTTP_ENV_VARS']"; > break; > > case 'server': > $compiled_ref = "\$GLOBALS['HTTP_SERVER_VARS']"; > break; > > case 'session': > $compiled_ref = "\$GLOBALS['HTTP_SESSION_VARS']"; > break; > > I believed, we had to use: $_SERVER, ... > Did I download a bad version, or? The superglobals ($_SERVER, $_POST, $_GET, etc) are preferred, but the haven't always been in the language. $HTTP_*_VARS have been in the language forever (or so), but they not automatically available in all scopes and aren't protected from userspace modifications as are the superglobals. However, despite the fact that $HTTP_*_VARS are not really recommended anymore, they also are not poisonous. :) Hope this helps, Torben > Steve -- Torben Wilson <torben@php.net> +1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====-----

« previous php.smarty.general (#9672) next »