Commit ec2b794f authored by Nicolas Fella's avatar Nicolas Fella Committed by Albert Vaca Cintora

Escape HTML Characters in Notifications.

REVIEW: 130114
parent f0010763
......@@ -82,18 +82,22 @@ KNotification* Notification::createKNotification(bool update, const NetworkPacka
mNotification->setComponentName(QStringLiteral("kdeconnect"));
}
mNotification->setTitle(mAppName);
QString escapedTitle = mTitle.toHtmlEscaped();
QString escapedText = mText.toHtmlEscaped();
QString escapedTicker = mTicker.toHtmlEscaped();
mNotification->setTitle(mAppName.toHtmlEscaped());
if (mTitle.isEmpty() && mText.isEmpty()) {
mNotification->setText(mTicker);
mNotification->setText(escapedTicker);
} else if (mAppName==mTitle) {
mNotification->setText(mText);
mNotification->setText(escapedText);
} else if (mTitle.isEmpty()){
mNotification->setText(mText);
mNotification->setText(escapedText);
} else if (mText.isEmpty()){
mNotification->setText(mTitle);
mNotification->setText(escapedTitle);
} else {
mNotification->setText(mTitle+": "+mText);
mNotification->setText(escapedTitle+": "+escapedText);
}
if (!mHasIcon) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment