! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
exo-open's MATCH_BROWSER opens everything
Status:
RESOLVED: FIXED

Comments

Description Sapphire Becker 2011-02-14 02:19:41 CET
#define MATCH_BROWSER "^(([^:/?#]+)://)?([^/?#])([^?#]*)(\\?([^#]*))?(#(.*))?"

This RegEx is horribly written and matches nearly everything possible. If I knew what the entirety of the goal is for it I would offer a correction.

It's used both in 0.3.106 and 0.6.0, however I'm running 0.3.106 and that's where it's giving me a headache currently, trying to implement a custom protocol for use in Chrome.
No matter what, because this line *ALWAYS* matches, all exo-open will do is open another Chrome window. It will *NEVER* default to gnome-open like it should.

(Note: The only things that won't match are things that start with one of /?# which is, of course, nothing you'd ever pass to exo-open)

Honestly I'd suggest only opening http:// and https:// links in the browser. Sure browsers handle other stuff, but that's all they're really meant for.
Comment 1 Nick Schermer editbugs 2011-02-15 11:53:11 CET
Yeah, true. Probably better to use the regexes from terminal for this: http://git.xfce.org/apps/terminal/tree/terminal/terminal-widget.c
Comment 2 Nick Schermer editbugs 2011-05-09 18:46:11 CEST
Applied a much better regex in 2c655ce.

Bug #7281

Reported by:
Sapphire Becker
Reported on: 2011-02-14
Last modified on: 2011-05-09

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
unspecified

Attachments

Additional information