XaminProject / handlebars.php

Handlebars processor for php
331 stars 134 forks source link

Zero before closing tag causes parser error #76

Closed adamaveray closed 9 years ago

adamaveray commented 9 years ago

Super specific error: if you have a single 0 before a closing tag for a condition, like this...

{{#if someVar}}0{{/if}}

...the parser gives you the following error:

Unexpected closing tag: /0if on line 78 in [...]/xamin/handlebars.php/src/Handlebars/Parser.php

The issue also happens if there's an {{else}} tag but still only a single 0 between it and the closing tag, like so:

{{#if someVar}}anything{{else}}0{{/if}}

It only happens with exactly a 0 – the following examples work correctly:

{{#if someVar}}1{{/if}}  {{! Works }}
{{#if someVar}} 0{{/if}} {{! Works }}
{{#if someVar}}a{{/if}}  {{! Works }}
everplays commented 9 years ago

thanks for the report @adamaveray, it's fixed now.