3 ms·
In my experience it's pretty rare for template language bugs to cause errors if user entered content includes one of their special characters. The template woul
by simonw 15y ago
In my experience it's pretty rare for template language bugs to cause errors if user entered content includes one of their special characters. The template would have to be evaluated twice for any problems to occur - once to insert the user's template code in to placeholders within the original template , and then once again to execute the resulting combination.
- kragen 15y agoSad to say, Mustache.js has exactly this bug last time I checked, but only under some circumstances. Minimal reproduction: Mustache.to_html('{{b}}', {b: '{{c}x}' }) -> '{{c}x}' Mustache.to_html('{{#a}}{{b}}{{/a}}', {a: [{b: '{{c}x}' }]}) -> '{{c}x}' Mustache.to_html('{{b}}', {b: '{{c}}' }) -> '{{c}}' Mustache.to_html('{{#a}}{{b}}{{/a}}', {a: [{b: '{{c}}' }]}) -> '' (wrong)