"Only variable references should be returned by reference"

Thomas Schulz <[email protected]> Mon, 07 Nov 2005 18:54:14 +0100
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
Have such notices triggered by &get_config_vars() since upgrade to PHP 
4.4.1 / Smarty 2.6.10:

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