hardcoded list of protocols for urlification is a maintenance burden and duplicate code

Bug #691846 reported by Robert Collins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

    @staticmethod
+ def _linkify_url_is_blacklisted(url):
+ '''Don't linkify URIs consisting of just the protocol'''
+
+ blacklist_bases = [
+ 'about',
+ 'gopher',
+ 'http',
+ 'https',
+ 'sftp',
+ 'news',
+ 'ftp',
+ 'mailto',
+ 'irc',
+ 'jabber',
+ 'apt',
+ 'data',
+ ]
+
+ for base in blacklist_bases:
+ if url in ('%s' % base, '%s:' % base, '%s://' % base):
+ return True
+ return False

from
https://code.launchpad.net/~jcsackett/launchpad/linkifier-bugs-2/+merge/43980

There's no need to manually list these, we should just use the url facilities to identify things without more than the scheme populated.

Curtis Hovey (sinzui)
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
tags: added: bugjam2010
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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