Merge lp:~osomon/ubuntu/focal/apport/upgrade-urls-re into lp:~ubuntu-core-dev/ubuntu/focal/apport/ubuntu

Proposed by Olivier Tilloy
Status: Merged
Merge reported by: Brian Murray
Merged at revision: not available
Proposed branch: lp:~osomon/ubuntu/focal/apport/upgrade-urls-re
Merge into: lp:~ubuntu-core-dev/ubuntu/focal/apport/ubuntu
Diff against target: 27 lines (+8/-1)
2 files modified
debian/changelog (+7/-0)
gtk/apport-gtk (+1/-1)
To merge this branch: bzr merge lp:~osomon/ubuntu/focal/apport/upgrade-urls-re
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+382846@code.launchpad.net

Description of the change

This is a quick fix for bug #1871185.

Matching all valid URLs with a regular expression is a complex problem, so I'm pretty sure this doesn't cover all cases, but at least it covers the case for "ubuntu-bug chromium" (scratching my own itch).

I wonder though, shouldn't that code be refactored to build a hyperlink from the URL before inserting it into the text (when setting the value of report['UnreportableReason'] in collect_info())? In that way there wouldn't be a need for using regular expressions to guess where a URL might be.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

I merged this but somehow Launchpad didn't catch it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2020-04-16 00:21:14 +0000
3+++ debian/changelog 2020-04-23 12:27:25 +0000
4@@ -1,3 +1,10 @@
5+apport (2.20.11-0ubuntu28) UNRELEASED; urgency=medium
6+
7+ * gtk/apport-gtk: upgrade regular expression used to match URLs in free text
8+ (LP: #1871185)
9+
10+ -- Olivier Tilloy <olivier.tilloy@canonical.com> Thu, 23 Apr 2020 14:14:52 +0200
11+
12 apport (2.20.11-0ubuntu27) focal; urgency=medium
13
14 * backends/packaging-apt-dpkg.py, apport/sandboxutils.py: Add modifications
15
16=== modified file 'gtk/apport-gtk'
17--- gtk/apport-gtk 2019-05-16 19:37:48 +0000
18+++ gtk/apport-gtk 2020-04-23 12:27:25 +0000
19@@ -386,7 +386,7 @@
20 if not isinstance(text, bytes):
21 text = text.encode('UTF-8')
22 text = GLib.markup_escape_text(text)
23- text = re.sub(r'(https?://[a-zA-Z0-9._-]+(?:[a-zA-Z0-9_#?%/-])*)',
24+ text = re.sub(r'(https?://[a-zA-Z0-9._-]+(?:[a-zA-Z0-9_#?%+=./-])*)',
25 r'<a href="\1">\1</a>', text)
26 # turn URLs into links
27 self.md.set_markup(text)

Subscribers

People subscribed via source and target branches