mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-18 13:20:59 +00:00
removed is_safe_js_url
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2995 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
daaaf5cd6b
commit
8d67ee35ef
2 changed files with 0 additions and 26 deletions
|
|
@ -398,10 +398,6 @@ class TestUrl (tests.StandardTest):
|
|||
self.assert_(linkcheck.url.is_safe_url(u), u)
|
||||
u = "http://www.imadoofus.com#anchor55"
|
||||
self.assert_(linkcheck.url.is_safe_url(u), u)
|
||||
u = "http://www.imadoofus.com/?hulla=do"
|
||||
self.assert_(linkcheck.url.is_safe_js_url(u), u)
|
||||
u = "http://www.imadoofus.com/foo.bar/woot/bla;a=120x600;b=615660"
|
||||
self.assert_(linkcheck.url.is_safe_js_url(u), u)
|
||||
|
||||
def test_needs_quoting (self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -87,28 +87,6 @@ def splitparams (path):
|
|||
return path[:i], path[i+1:]
|
||||
|
||||
|
||||
def is_safe_js_url (urlstr):
|
||||
"""
|
||||
Test javascript URL strings.
|
||||
"""
|
||||
url = list(urlparse.urlsplit(urlstr))
|
||||
if url[0].lower() not in ('http', 'https'):
|
||||
return False
|
||||
if not is_safe_host(url[1]):
|
||||
return False
|
||||
if ";" in urlstr:
|
||||
url[2], parameter = splitparams(url[2])
|
||||
if not is_safe_parameter(parameter):
|
||||
return False
|
||||
if not is_safe_path(url[2]):
|
||||
return False
|
||||
if not is_safe_query(url[3]):
|
||||
return False
|
||||
if not is_safe_fragment(url[4]):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def is_numeric_port (portstr):
|
||||
"""
|
||||
return True iff portstr is a valid port number
|
||||
|
|
|
|||
Loading…
Reference in a new issue