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 {