Project

General

Profile

Actions

Bug #865

closed
BN KD

WTemplate::bindString() with invalid xml

Bug #865: WTemplate::bindString() with invalid xml

Added by Boris Nagaev about 15 years ago. Updated about 15 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

KD Updated by Koen Deforche about 15 years ago Actions #1

  • 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

BN Updated by Boris Nagaev about 15 years ago Actions #2

Use localized WString as template.
Example in attachment shows "text" with italics, but should not.

KD Updated by Koen Deforche about 15 years ago Actions #3

  • 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

KD Updated by Koen Deforche about 15 years ago Actions #4

  • Target version set to 3.1.10

KD Updated by Koen Deforche about 15 years ago Actions #5

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom