Project

General

Profile

Actions

Bug #865

closed

WTemplate::bindString() with invalid xml

Added by Boris Nagaev almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
06/21/2011
Due date:
% Done:

0%

Estimated time:

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

test172.cc (789 Bytes) test172.cc Koen Deforche, 06/23/2011 04:56 PM
1.cpp (844 Bytes) 1.cpp Boris Nagaev, 06/23/2011 08:07 PM
1.xml (124 Bytes) 1.xml Boris Nagaev, 06/23/2011 08:07 PM
Actions #1

Updated by Koen Deforche almost 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 almost 13 years ago

Use localized WString as template.

Example in attachment shows "text" with italics, but should not.

Actions #3

Updated by Koen Deforche almost 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

Actions #4

Updated by Koen Deforche almost 13 years ago

  • Target version set to 3.1.10
Actions #5

Updated by Koen Deforche almost 13 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF