Sanitize the body before doing anything else.
Cleanup grouping logic.
Details
Details
- Reviewers
davidedmundson aacid fvogt - Group Reviewers
Plasma - Commits
- R120:8164beac15ea: [Notifications] Fix grouping
Unit test still passes
notify-send "Test" "Hello"; notify-send "Test" "Hello"
resulted in a single popup with "Test" summary and body
Hello
notify-send "Test" "Hello"; notify-send "Test" "Darkness"
resulted in a single popup with "Test" summary and body
Hello
Darkness
(previously the notification would become empty)
Verified that non-whitelisted tags like <h1> were still filtered out in both cases
notify-send "Test" "Hello"; notify-send "Test2" "Hello"
resulted in two separate popups. Also couldn't observe any "notification contained invalid XML" warnings on console.
Diff Detail
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
dataengines/notifications/notificationsengine.cpp | ||
---|---|---|
250 | I don't like magic numbers, maybe sizeof("<?xml version="1.0"><html></html>")-1? |
Comment Actions
Note that the unit test doesn't touch any of the code you modified, it passing isn't a sign of anything.
Does 5.8 need fixing?
dataengines/notifications/notificationsengine.cpp | ||
---|---|---|
250 | strlen not sizeof |
dataengines/notifications/notificationsengine.cpp | ||
---|---|---|
214 | This results in ...Text<br/><?xml version="1.0"?><html>Some text... AFAICT. This also means that the if condition is always false. |