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 673301 - Nearby Sites (zeroconf) bookmark matches any string in address bar
Nearby Sites (zeroconf) bookmark matches any string in address bar
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Bookmarks
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
: 673908 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-04-01 16:43 UTC by Adam Dingle
Modified: 2012-04-11 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
normalize-add-bookmark.diff (1.56 KB, patch)
2012-04-02 20:46 UTC, Xan Lopez
none Details | Review

Description Adam Dingle 2012-04-01 16:43:27 UTC
Epiphany displays the following Zeroconf bookmark for me in Bookmarks->Nearby Sites:

Photosmart C309a series [0BEDFB] [0BEDFC]

This is potentially useful.  Unfortunately this bookmark matches *any* string that I enter in the address bar.  (And it appears above all other matches in the dropdown list, adding to the inconvenience.)
Comment 1 Xan Lopez 2012-04-02 10:06:00 UTC
Wow, this is really weird. What are the keywords for that bookmark?
Comment 2 Adam Dingle 2012-04-02 17:31:22 UTC
The bookmark appears only under the All and Nearby Sites topics in the Bookmarks window.
Comment 3 Adam Dingle 2012-04-02 18:10:23 UTC
I debugged a bit.  When Epiphany calls should_add_bookmark_to_model() to test whether the search string should match this particular bookmark, the keywords argument is null:

should_add_bookmark_to_model: search = x, title = Photosmart C309a series [0BEDFB] [0BEDFC], location = http://192.168.1.3:80/, keywords = (null)

This causes g_regex_match to return true (and report an assertion somewhere, presumably), so the bookmark matches any string.
Comment 4 Xan Lopez 2012-04-02 20:35:01 UTC
(In reply to comment #3)
> I debugged a bit.  When Epiphany calls should_add_bookmark_to_model() to test
> whether the search string should match this particular bookmark, the keywords
> argument is null:
> 
> should_add_bookmark_to_model: search = x, title = Photosmart C309a series
> [0BEDFB] [0BEDFC], location = http://192.168.1.3:80/, keywords = (null)
> 
> This causes g_regex_match to return true (and report an assertion somewhere,
> presumably), so the bookmark matches any string.

Thank you, I suspected something like that, since we had a similar bug earlier with title/location being NULL. I'll just normalize the keywords too.
Comment 5 Xan Lopez 2012-04-02 20:46:16 UTC
Created attachment 211187 [details] [review]
normalize-add-bookmark.diff

Adam, could you try this and see if it works? The code was actually already trying to make this case work, but not correctly.
Comment 6 Adam Dingle 2012-04-02 20:51:53 UTC
The patch fixes the problem.  Thanks!
Comment 7 Xan Lopez 2012-04-02 20:55:36 UTC
Great, pushed it to master and gnome-3-4. Thanks for the great bug report.
Comment 8 Xan Lopez 2012-04-11 14:11:55 UTC
*** Bug 673908 has been marked as a duplicate of this bug. ***