tonic
tonic copied to clipboard
`handleIfs()` replaces parts of variable names if they are "or"
The handleIfs()
function replaces "or" in a variable name with ||
.
This makes $selector
to $select||
which results in an error because eval()
fails.
This also happens with the conditions. {$selector eq "portfolio"}
becomes `{$select|| eq "p||tfolio"}
Stupid idea to fix this issue. At https://github.com/rgamba/tonic/blob/master/src/Tonic.php#L826 replace edit every items of arrays in str_replace()
adding whitespaces before and after, eg.:
$condition=str_replace(array(
' eq ',
' gt ',
...
),array(
' == ',
' > ',
...
),$condition);
Actually, I think that's a great solution.