Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/sources.py

Issue 29376948: Noissue - Adding support for tel link scheme in Source.resolve_link of CMS (Closed) Base URL: https://hg.adblockplus.org/cms
Patch Set: Address my own feedback Created Feb. 24, 2017, 2:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/sources.py
===================================================================
--- a/cms/sources.py
+++ b/cms/sources.py
@@ -28,16 +28,20 @@
class Source:
def resolve_link(self, url, locale):
parsed = urlparse.urlparse(url)
page = parsed.path
if parsed.scheme != '' or page.startswith('/') or page.startswith('.'):
# Not a page link
return None, None
+ if url.startswith('tel:'):
+ # Workaround for 'tel' scheme not recognized on some platforms.
Sebastian Noack 2017/02/24 14:32:08 If this is related to the Python version, as you s
Vasily Kuznetsov 2017/02/24 16:48:09 Done.
+ return None, None
+
if page == '' and url != '':
# Page-relative link
return None, None
config = self.read_config()
default_locale = config.get('general', 'defaultlocale')
default_page = config.get('general', 'defaultpage')
alternative_page = '/'.join([page.rstrip('/'), default_page]).lstrip('/')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld