add forgotten calls for url/html escape
authorteodor <teodor>
Tue, 30 Sep 2008 13:26:12 +0000 (13:26 +0000)
committerteodor <teodor>
Tue, 30 Sep 2008 13:26:12 +0000 (13:26 +0000)
template.c

index 4f6fbdd..6561ee1 100644 (file)
@@ -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);
                                }