Bug #865
closedWTemplate::bindString() with invalid xml
0%
Description
When WTemplate::bindString() is called with invalid xml (like ""), it omits this error and prints raw value.
It results in marking all page with italic (if value is "").
Look at WTemplate::bindString documentation:
Depending on the textFormat, the value is validated according as for a WText.
But WText("") would be printed as plain text.
Probably, WTemplate::bindString should be similar to WTemplate::bindWidget with WText as a widget.
Could you fix WTemplate::bindString() to be completely safe with invalid xml?
Files
Updated by Koen Deforche over 13 years ago
- File test172.cc test172.cc added
- Status changed from New to Feedback
- Assignee set to Koen Deforche
Hey,
I cannot reproduce this though. See attached test case. Can you modify it to trigger the wrong behavior you see?
I get the error message as expected ([2011-Jun-23 16:52:36.661680] 27559 [/ tqpTgf610b5eKoMo] [error] "Error reading XHTML string: invalid closing tag name") after which the rendering is switched from XHTMLText to PlainText.
Regards,
koen
Updated by Boris Nagaev over 13 years ago
Use localized WString as template.
Example in attachment shows "text" with italics, but should not.
Updated by Koen Deforche over 13 years ago
- Status changed from Feedback to Resolved
Hey,
Appreciated! It was a typo: instead of considering the string to be bound, I was considering the template text for the condition to sanitize ...
Regards,
koen
Updated by Koen Deforche over 13 years ago
- Status changed from Resolved to Closed