mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-11 10:00:58 +00:00
add pipe to safe url chars
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1950 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
088cf521a8
commit
7ee019da0f
1 changed files with 3 additions and 2 deletions
|
|
@ -316,7 +316,8 @@ def match_host (host, domainlist):
|
|||
return False
|
||||
|
||||
|
||||
_safe_url_chars = re.compile(r"^[-a-zA-Z0-9_:/\.,~;=&#%()@\?]*$")
|
||||
_safe_url_chars = r"-a-zA-Z0-9_:/\.,~;=&#%()@\?\|"
|
||||
_safe_url_chars_ro = re.compile(r"^[%s]*$" % _safe_url_chars)
|
||||
def url_needs_quoting (url):
|
||||
"""Check if url needs percent quoting. Note that the method does
|
||||
only check basic character sets, and not any other syntax.
|
||||
|
|
@ -327,7 +328,7 @@ def url_needs_quoting (url):
|
|||
# handle trailing whitespace as a special case
|
||||
# since '$' matches immediately before a end-of-line
|
||||
return True
|
||||
return not _safe_url_chars.match(url)
|
||||
return not _safe_url_chars_ro.match(url)
|
||||
|
||||
|
||||
def spliturl (url):
|
||||
|
|
|
|||
Loading…
Reference in a new issue