After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719683 - Escaping issue "Failed to set text from markup due to error parsing markup" when using bookmark containing '&'
Escaping issue "Failed to set text from markup due to error parsing markup" w...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.16.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-12-02 13:22 UTC by Christian Stadelmann
Modified: 2015-05-24 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
placessidebar: escape tooltip text before setting it (1.84 KB, patch)
2015-05-23 23:19 UTC, Cosimo Cecchi
accepted-commit_now Details | Review

Description Christian Stadelmann 2013-12-02 13:22:15 UTC
Steps to reproduce:
1. create a folder, rename it to something containing '&', e.g. "a&b"
2. add this folder to bookmarks bar
3. watch Nautilus printing stdout/stderr

Nautilus generates this output multiple times per second:
~~~~~
(nautilus:5461): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Fehler in Zeile 1: Entität endete nicht mit einem Semikolon; wahrscheinlich haben Sie ein &-Zeichen benutzt, ohne eine Entität beginnen zu wollen - umschreiben Sie das »&« als &
~~~~~
(translated:) Error in line 1: Entity not terminated with semicolon; You probably used the character & without trying to start an entity – replace »&« with &

I think there is some escaping missing.

Additional info:
The same problem exists with bookmark names containing '<', e.g. "a<b"
~~~~~
Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Fehler in Zeile 1, Zeichen 30: »b<« ist kein gültiger Name: »<«
~~~~~
(translated:) Error in line 1: Character 30: »b<« is no valid name: »<«

This probably happens with other HTML/XML special characters too.
Comment 1 Christian Stadelmann 2015-05-04 18:21:05 UTC
This bug is still present in Nautilus 3.16
Comment 2 Cosimo Cecchi 2015-05-23 23:18:32 UTC
-> gtk+

The bug is in GtkPlacesSidebar.
Comment 3 Cosimo Cecchi 2015-05-23 23:19:42 UTC
Created attachment 303872 [details] [review]
placessidebar: escape tooltip text before setting it

gtk_tree_view_set_tooltip_column() specifies that markup in the text
should be escaped.
This fixes critical warnings when hovering over items in the sidebar for
bookmarks that have markup characters in their names.
Comment 4 Matthias Clasen 2015-05-24 13:42:04 UTC
Review of attachment 303872 [details] [review]:

sure
Comment 5 Cosimo Cecchi 2015-05-24 19:04:59 UTC
Thanks, pushed to master.

Attachment 303872 [details] pushed as e0b1ea1 - placessidebar: escape tooltip text before setting it