From 223f3fa6588390dca6c3a71d2e93c9be7d8a0fd9 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 21 Aug 2013 03:25:18 -0400 Subject: [PATCH] Actually, they're called URI schemes, not URL schemes. --- mwparserfromhell/definitions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mwparserfromhell/definitions.py b/mwparserfromhell/definitions.py index 1cc1eb5..ef8255e 100644 --- a/mwparserfromhell/definitions.py +++ b/mwparserfromhell/definitions.py @@ -27,7 +27,7 @@ from __future__ import unicode_literals __all__ = ["get_html_tag", "is_parsable", "is_visible", "is_single", "is_single_only", "is_scheme"] -URL_SCHEMES = { +URI_SCHEMES = { # [mediawiki/core.git]/includes/DefaultSettings.php @ 374a0ad943 "http": True, "https": True, "ftp": True, "ftps": True, "ssh": True, "sftp": True, "irc": True, "ircs": True, "xmpp": False, "sip": False, @@ -83,6 +83,7 @@ def is_single_only(tag): def is_scheme(scheme, slashes=True): """Return whether *scheme* is valid for external links.""" + scheme = scheme.lower() if slashes: - return scheme in URL_SCHEMES - return scheme in URL_SCHEMES and not URL_SCHEMES[scheme] + return scheme in URI_SCHEMES + return scheme in URI_SCHEMES and not URI_SCHEMES[scheme]