diff options
author | Igor Wiedler <igor@wiedler.ch> | 2011-04-26 02:09:51 +0200 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-25 23:19:36 -0400 |
commit | 427a5122d55f06c861277297411f7e39a03a703c (patch) | |
tree | 3abfb707f699113204d7c7a7d4ca04b24e70c65b /tests/template/templates | |
parent | f0b97cfdcf851eec4660412e4c061a26b921c740 (diff) | |
download | forums-427a5122d55f06c861277297411f7e39a03a703c.tar forums-427a5122d55f06c861277297411f7e39a03a703c.tar.gz forums-427a5122d55f06c861277297411f7e39a03a703c.tar.bz2 forums-427a5122d55f06c861277297411f7e39a03a703c.tar.xz forums-427a5122d55f06c861277297411f7e39a03a703c.zip |
[feature/template-engine] Fix negative variable expressions
compile_tag_if had the flawed approach of adding an isset statement for
all variables to the beginning of the if. This fails for negative
expressions, and checking those takes a considerable effort.
The easier solution is to make the variable expression itself
conditional, defaulting to null if it is not set.
Thanks to naderman for the solution.
PHPBB3-9726
Diffstat (limited to 'tests/template/templates')
-rw-r--r-- | tests/template/templates/basic.html | 3 | ||||
-rw-r--r-- | tests/template/templates/if.html | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/template/templates/basic.html b/tests/template/templates/basic.html index c1dd690260..e5c6f280fb 100644 --- a/tests/template/templates/basic.html +++ b/tests/template/templates/basic.html @@ -16,5 +16,8 @@ fail <!-- BEGINELSE --> pass <!-- END empty --> +<!-- IF not S_EMPTY --> +pass +<!-- ENDIF --> <!-- DUMMY var --> diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html index 41ff024779..eed431019e 100644 --- a/tests/template/templates/if.html +++ b/tests/template/templates/if.html @@ -6,6 +6,6 @@ 03 <!-- ENDIF --> -<!-- IF (S_VALUE > S_OTHER_VALUE) --> +<!-- IF S_VALUE and S_OTHER_VALUE and (S_VALUE > S_OTHER_VALUE) --> 04 <!-- ENDIF --> |