Minor cosmetic fix in Smarty 2.4.0 and support for "null" parameter
| From: | Andr� Rabold | Date: | Mon, 03 Feb 2003 14:47:06 +0000 |
| Subject: | Minor cosmetic fix in Smarty 2.4.0 and support for "null" parameter | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-658@lists.php.net to get a copy of this message | ||
I just discovered a small bug in Smarty 2.4.0. I'm not sure if this error
occured in former versions.
Smarty_Compiler doesn't compile function parameters "true" and "false"
correctly. Instead of printing "true" and "false" into the compiled template
it outputs "1" and "0". This is nearly the same but I just thought it should
be corrected.
I have searched the source and discovered the lines 1329 - 1332. Instead of
setting token to true or false i set it to the correct string now:
1329: if (preg_match('!^(on|yes|true)$!', $token))
1330: $token = 'true';
1331: else if (preg_match('!^(off|no|false)$!', $token))
1332: $token = 'false';
Afterwards I added support for "null" as possible parameter:
53: var $_permitted_tokens =
array('true','false','yes','no','on','off','null');
1331: else if (preg_match('!^(off|no|false)$!', $token))
1332: $token = 'false';
> else if ($token == null)
> $token = 'null';
1333: /* If the token is just a string,
1334: we double-quote it. */
Bye,
André