From: teodor Date: Tue, 30 Sep 2008 13:26:12 +0000 (+0000) Subject: add forgotten calls for url/html escape X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=3f7c8792d1c2cd223e2d8a62815b7f67fa7d7c6b;p=tedtools.git add forgotten calls for url/html escape --- diff --git a/template.c b/template.c index 4f6fbdd..6561ee1 100644 --- a/template.c +++ b/template.c @@ -623,6 +623,7 @@ printVal( Template tmpl, VariableValue value, int *len, char *format ) { } *len = printedlen; + return res; } @@ -758,7 +759,13 @@ printNode( Template tmpl, TemplateNode node ) { char *res; res = printVal(tmpl, value, &len, node->nodeData.variable.formatValue); - if ( res && len>0 ) { + + if ( (node->nodeData.variable.flags & TND_HTMLESCAPE) && tmpl->htmlEscape ) + res = tmpl->htmlEscape(res, &len); + if ( (node->nodeData.variable.flags & TND_URLESCAPE) && tmpl->urlEscape ) + res = tmpl->urlEscape(res, &len); + + if ( res && len>0 ) { tmpl->printString( res, len ); mcfree(res); }