Escape HTML Characters in Notifications.
REVIEW: 130114
This commit is contained in:
parent
f0010763e7
commit
ec2b794ffb
1 changed files with 10 additions and 6 deletions
|
@ -82,18 +82,22 @@ KNotification* Notification::createKNotification(bool update, const NetworkPacka
|
||||||
mNotification->setComponentName(QStringLiteral("kdeconnect"));
|
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()) {
|
if (mTitle.isEmpty() && mText.isEmpty()) {
|
||||||
mNotification->setText(mTicker);
|
mNotification->setText(escapedTicker);
|
||||||
} else if (mAppName==mTitle) {
|
} else if (mAppName==mTitle) {
|
||||||
mNotification->setText(mText);
|
mNotification->setText(escapedText);
|
||||||
} else if (mTitle.isEmpty()){
|
} else if (mTitle.isEmpty()){
|
||||||
mNotification->setText(mText);
|
mNotification->setText(escapedText);
|
||||||
} else if (mText.isEmpty()){
|
} else if (mText.isEmpty()){
|
||||||
mNotification->setText(mTitle);
|
mNotification->setText(escapedTitle);
|
||||||
} else {
|
} else {
|
||||||
mNotification->setText(mTitle+": "+mText);
|
mNotification->setText(escapedTitle+": "+escapedText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mHasIcon) {
|
if (!mHasIcon) {
|
||||||
|
|
Loading…
Reference in a new issue