Skip to content

Commit 101b079

Browse files
committed
Emphasize that _.template must only be used for trusted input in doc
1 parent f8db7b9 commit 101b079

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,6 +2692,12 @@ <h2 id="utility">Utility Functions</h2>
26922692
should be a hash containing any <tt>_.templateSettings</tt> that should be overridden.
26932693
</p>
26942694

2695+
<p role=note>
2696+
<em><tt>_.template</tt> allows the template author to insert arbitrary
2697+
JavaScript code by design. This means that you should only pass template
2698+
code from trusted authors.</em>
2699+
</p>
2700+
26952701
<pre>
26962702
var compiled = _.template("hello: &lt;%= name %&gt;");
26972703
compiled({name: 'moe'});

0 commit comments

Comments
 (0)