Some HTML tags cause all tags to appear as raw code

Bug #339020 reported by Matthew Paul Thomas
4
Affects Status Importance Assigned to Milestone
notify-osd (Ubuntu)
Fix Released
Low
Cody Russell

Bug Description

notify-osd 0.9ubuntu2, Ubuntu Jaunty

At a terminal, enter:
1. notify-send 'test' '<b>Markup</b> should be <i>filtered</i>.'
2. notify-send 'test' '<b>Markup</b> should be <a href="http://example.com/">filtered</a>.'

What happens:
1. A notification bubble appears with body text 'Markup should be filtered.'
2. A notification bubble appears with body text '<b>Markup</b> should be <a href="http://example.com/">filtered</a>.'

What should happen, as defined in the spec <https://wiki.ubuntu.com/NotifyOSD#Sanitizing%20body%20text>:
1. A notification bubble appears with body text 'Markup should be filtered.'
2. A notification bubble appears with body text 'Markup should be filtered.'

In a fallback alert box, the same code apparently causes the body text not to appear at all. <http://launchpadlibrarian.net/23735670/kerneloops-notify-bad.jpg> Fallback alert box text should appear, with exactly the same filtering as notification bubble text has.

Related branches

Changed in notify-osd:
importance: Undecided → Low
description: updated
Revision history for this message
Mirco Müller (macslow) wrote :

Doing that will take some time.

Changed in notify-osd:
assignee: nobody → macslow
status: New → Confirmed
Changed in notify-osd:
assignee: macslow → eeejay
David Barth (dbarth)
Changed in notify-osd:
assignee: nobody → eeejay
David Barth (dbarth)
Changed in notify-osd:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Cody Russell (bratsche) wrote :

I was messing around with this one this morning and tried to regex the HTML code out, but it didn't seem to work. Here's the regex code that I used so you can see it on the command line.

I replaced the g_markup_escape_text() with this, and when I notify-send I can still see <a href> type markup, but it seems to filter out <b>. I wonder if something is filtering the code before the bubble gets it?

Revision history for this message
Cody Russell (bratsche) wrote :

Uhh, it turns out I was trying to filter it in dialog.c and not bubble.c.

"Oops." :)

Changed in notify-osd:
assignee: eeejay → bratsche
assignee: eeejay → bratsche
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Cody, in <https://wiki.ubuntu.com/NotificationDevelopmentGuidelines#escaping> I've included a table of examples that you could use for test cases. (The "As displayed by Notify OSD" column shows what Notify OSD should emit when it implements the design spec, not what it currently emits.;-)

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

As for dialog.c vs. bubble.c, keep in mind that exactly the same text should be presented in a fallback alert box as in a notification bubble (though the font, layout etc obviously differ). So perhaps the escaping -- and the whitespace filtering -- should be done somewhere that is neither dialog.c nor bubble.c.

Revision history for this message
Cody Russell (bratsche) wrote :
Cody Russell (bratsche)
Changed in notify-osd:
status: Confirmed → Fix Released
status: Confirmed → Fix Released
no longer affects: notify-osd
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.