MDL-53509 mod_forum: Stop over-escaping quoted variables

{{# quote }}<a href=\"foo\">{{/ quote }}

becomes:

    "<a href=\\"foo\\">"

This causes a mustache syntax error.

The quote helper negates the need to escape quotes in normal use, e.g.:

    {{# quote }}<a href="foo">{{/ quote }}

which instead becomes:

    "<a href=\"foo\">"
This commit is contained in:
Andrew Nicols 2016-03-17 08:33:46 +08:00
parent 7adc7ef14f
commit 48a9ef9e96

View File

@ -44,7 +44,7 @@
<div>
<a target="_blank" href="{{{ permalink }}}">{{{ subject }}}</a>
{{# str }} bynameondate, forum, {
"name": {{# quote }}<a target=\"_blank\" href=\"{{{ authorlink }}}\">{{ authorfullname }}</a>{{/ quote }},
"name": {{# quote }}<a target="_blank" href="{{{ authorlink }}}">{{ authorfullname }}</a>{{/ quote }},
"date": {{# quote }}{{ postdate }}{{/ quote }}
} {{/ str }}
</div>