Properly sanitize titles of downloaded messages.
This commit is contained in:
parent
18491750fb
commit
cccd6ebee2
@ -178,8 +178,10 @@ void Feed::run() {
|
|||||||
|
|
||||||
// Sanitize title. Remove newlines etc.
|
// Sanitize title. Remove newlines etc.
|
||||||
msgs[i].m_title = QUrl::fromPercentEncoding(msgs[i].m_title.toUtf8())
|
msgs[i].m_title = QUrl::fromPercentEncoding(msgs[i].m_title.toUtf8())
|
||||||
.remove(QRegExp(QSL("[\\n\\r\\t]")))
|
// Replace all continuous white space.
|
||||||
.replace(QRegExp(QSL("[]")), QSL(" "));
|
.replace(QRegExp(QSL("[\\s]{2,}")), QSL(" "))
|
||||||
|
// Remove all newlines and leading white space.
|
||||||
|
.remove(QRegExp(QSL("([\\n\\r])|(^\\s)")));
|
||||||
}
|
}
|
||||||
|
|
||||||
emit messagesObtained(msgs, error_during_obtaining);
|
emit messagesObtained(msgs, error_during_obtaining);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user