Re: Bug with default_modifiers and isset in if
[email protected] Sat, 18 Mar 2006 11:28:13 +0100
| Newsgroups | php.smarty.dev |
|---|---|
| Message-ID | <[email protected]> |
Fixed it myself...
Smarty_Compiler.class.php
Somewhat around line 1377
Just insert a new case:
case "isset":
++$i;
$token = &$tokens[$i];
if ($token != '(') {
$this->_syntax_error("no following ( after isset", E_USER_ERROR,
__FILE__, __LINE__);
}
++$i;
$token = &$tokens[$i];
$temp = $this->default_modifiers;
$this->default_modifiers = null;
$token = $this->_parse_var_props($token);
$this->default_modifiers = $temp;
if (substr($token, 0, 1) != '$') {
$this->_syntax_error("no variable in isset", E_USER_ERROR, __FILE__,
__LINE__);
}
++$i;
$token = &$tokens[$i];
if ($token != ')') {
$this->_syntax_error("no following ) after isset", E_USER_ERROR,
__FILE__, __LINE__);
}
break;
I don't know if there is an "easier" or "more beautiful" way ... this is
just a brutal fix (but it works ^^)