mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
escape when rendered
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
|
||||
{% if context %}
|
||||
{% set zterm %}
|
||||
{% trans with {'%term%' : term, '%context%' : context} %}thesaurus:: le terme %term% avec contexte %context%{% endtrans %}
|
||||
{% trans with {'%term%' : term | e, '%context%' : context | e} %}thesaurus:: le terme %term% avec contexte %context%{% endtrans %}
|
||||
{% endset %}
|
||||
{% else %}
|
||||
{% set zterm %}
|
||||
{% trans with {'%term%' : term} %}thesaurus:: le terme %term% sans contexte{% endtrans %}
|
||||
{% trans with {'%term%' : term | e} %}thesaurus:: le terme %term% sans contexte{% endtrans %}
|
||||
{% endset %}
|
||||
{% endif %}
|
||||
|
||||
|
@@ -338,6 +338,8 @@
|
||||
for(var sy=syl.item(0).firstChild; sy; sy=sy.nextSibling )
|
||||
{
|
||||
var lng = sy.getAttribute("lng");
|
||||
var v = escapeHtmlDataFromXML(sy.getAttribute("v"));
|
||||
|
||||
html += "<tr>";
|
||||
if(lng)
|
||||
if(tFlags[lng])
|
||||
@@ -347,7 +349,7 @@
|
||||
else
|
||||
html += "<td><span style='background-color:#cccccc'> ? </span></td>";
|
||||
|
||||
html += "<td> "+sy.getAttribute("v")+"</td>";
|
||||
html += "<td> "+ v +"</td>";
|
||||
|
||||
var hits = 0+sy.getAttribute("hits");
|
||||
if(hits == 1)
|
||||
@@ -361,6 +363,12 @@
|
||||
return(html);
|
||||
}
|
||||
|
||||
// Let the browser to do it
|
||||
function escapeHtmlDataFromXML(data){
|
||||
var d = document.createElement('div');
|
||||
d.appendChild(document.createTextNode(data));
|
||||
return d.innerHTML;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
Reference in New Issue
Block a user