Re: [SMARTY-DEV] "Only variable references should be returned by reference"

[email protected] (boots) Mon, 7 Nov 2005 21:09:55 -0800 (PST)
Newsgroups php.smarty.dev
Message-ID <[email protected]>
--- Thomas Schulz <[email protected]> wrote:

> Have such notices triggered by &get_config_vars() since upgrade to
> PHP 
> 4.4.1 / Smarty 2.6.10:

Hi.

Monte patched this shortly after the 2.6.10 release. It is availble in
CVS: http://news.php.net/php.smarty.cvs/1788

boots

> Run-time notice [8]
> Only variable references should be returned by reference
> in file "d:\docroots\tbweb\sys\libs\Smarty.class.php" line 1078
> 
> Similar bug was already fixed for &get_template_vars() in revision
> 1.518.
> 
> 
> Index: Smarty.class.php
> ===================================================================
> RCS file: /repository/smarty/libs/Smarty.class.php,v
> retrieving revision 1.519
> diff -u -w -b -r1.519 Smarty.class.php
> --- Smarty.class.php	17 Aug 2005 14:59:25 -0000	1.519
> +++ Smarty.class.php	7 Nov 2005 17:37:12 -0000
> @@ -1077,6 +1077,10 @@
>               return $this->_config[0]['vars'];
>           } else if(isset($this->_config[0]['vars'][$name])) {
>               return $this->_config[0]['vars'][$name];
> +        } else {
> +            // var non-existant, return valid reference
> +            $_tmp = null;
> +            return $_tmp;
>           }
>       }
> 
> -- 
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com