From d991ec9133f76e106c3df5f9cfa615dda972567c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Thu, 9 Jun 2016 08:09:12 +0000 Subject: [PATCH] filter special ascii commands from output, otherwise jenkins cannot read the test output xml file --- src/commands.hxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/commands.hxx b/src/commands.hxx index f06bad7..d9c90b3 100644 --- a/src/commands.hxx +++ b/src/commands.hxx @@ -436,11 +436,8 @@ class Script: public QObject { }; public: static QString xmlattr(QString attr, bool br = false) { - attr.replace("&", "&")//.replace(" ", " ") - .replace("\"", """); - if (br) attr.replace("\n", "
"); - attr.replace("<", "<").replace(">", ">"); - return attr; + if (br) return attr.toHtmlEscaped().replace("\n", "
"); + return attr.toHtmlEscaped(); } static QString xmlstr(const std::string& attr) { return xmlstr(QString::fromStdString(attr)); @@ -899,6 +896,7 @@ class Script: public QObject { QString prefix (QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss ")); Command* cmd(command?command:_command); + for (QChar& c: text) if (c<32) c='?'; if (cmd) prefix += QString("%2:%3%1 ") .arg(QString(cmd->indent(), QChar(' '))) @@ -2105,7 +2103,8 @@ class If: public Command { "less (as integer), bigger (as integer). " "Match allows a regular expression. " "The second variant checks for a text in a selector, " - "similar to command exists. " + "similar to command exists. The text can be empty to just " + "check for the existence of a selector. " "There is an optional else part."; } QString command() const {