#84 [NEW]: Lexing of method arguments off-by-one
| From: | jwadsack at wadsack-allen dot com | Date: | Fri, 10 Oct 2003 01:49:09 +0000 |
| Subject: | #84 [NEW]: Lexing of method arguments off-by-one | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-22538@lists.php.net to get a copy of this message | ||
From: jwadsack at wadsack-allen dot com
Operating system: Linux
PHP version: 4.3.1
PHP Bug Type: HTML_Template_Flexy
Bug description: Lexing of method arguments off-by-one
Description:
------------
HTML/Template/Flexy/Tokenizer.php:
2402c2402
< $t = substr($this->yytext(),0,-1);
---
> $t = $this->yytext();
The effect of this bug is that any single-character argument sent to a
method call is deleted, resulting in the element parser sending the object
instead of the variable.
Reproduce code:
---------------
{foreach:list,i}{method(i)}{end:}
Expected result:
----------------
<?php foreach( $t->list as $i ) { $t->method($i) } ?>
Actual result:
--------------
<?php foreach( $t->list as $i ) { $t->method($t) } ?>
(Note $t not $i as the argument)
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=84&edit=1
--