[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    [SMARTY-DEV] do not pass null to object methods
From:       Arpad Borsos <arpad () gamesweb ! com>
Date:       2005-06-27 15:26:13
Message-ID: 42C01A95.9030802 () gamesweb ! com
[Download RAW message or body]

when i do not enter any arguments, smarty passes null as argument, which 
breaks my method's default argument values.
eg.
function foobar($foo = 'defaultvalue')
doesnt work anymore. This is a small patch to stop smarty from passing 
null as argument.

-- 
________________________________
MfG Arpad Borsos aka "Swatinem"
http://localhost.renegade-planet.de
________________________________
Reclaim Your Inbox! - Mozilla Thunderbird
http://www.mozilla.org/products/thunderbird/

Take Back the Web! - Mozilla Firefox
http://www.mozilla.org/products/firefox/
________________________________


["Smarty_Compiler.class.php.patch" (text/plain)]

Index: Smarty_Compiler.class.php
===================================================================
RCS file: /repository/smarty/libs/Smarty_Compiler.class.php,v
retrieving revision 1.369
diff -u -r1.369 Smarty_Compiler.class.php
--- Smarty_Compiler.class.php	2 May 2005 14:03:18 -0000	1.369
+++ Smarty_Compiler.class.php	27 Jun 2005 15:12:32 -0000
@@ -857,7 +857,7 @@
             // traditional argument format
             $args = implode(',', array_values($attrs));
             if (empty($args)) {
-                $args = 'null';
+                $args = '';
             }
         }
 



-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic