mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-02 22:20:23 +00:00
quote urls before request or html output
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@875 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
979a8b5d42
commit
d0c3d124d0
2 changed files with 6 additions and 5 deletions
|
|
@ -16,7 +16,7 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
import urlparse, sys, time, re, httplib
|
||||
from urllib import unquote
|
||||
from urllib import quote, unquote
|
||||
import Config, StringUtil, i18n
|
||||
from linkcheck import robotparser
|
||||
from debug import *
|
||||
|
|
@ -242,7 +242,7 @@ class HttpUrlData (ProxyUrlData):
|
|||
else:
|
||||
path = urlparse.urlunsplit(('', '', self.urlparts[2],
|
||||
self.urlparts[3], self.urlparts[4]))
|
||||
self.urlConnection.putrequest(method, path, skip_host=1)
|
||||
self.urlConnection.putrequest(method, quote(path), skip_host=1)
|
||||
self.urlConnection.putheader("Host", host)
|
||||
# userinfo is from http://user@pass:host/
|
||||
if self.userinfo:
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ from StandardLogger import StandardLogger
|
|||
from Logger import Logger
|
||||
from linkcheck.log import strtime
|
||||
from linkcheck import StringUtil, i18n, Config
|
||||
from urllib import quote
|
||||
import time
|
||||
|
||||
HTML_HEADER = """<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01//EN">
|
||||
|
|
@ -81,8 +82,8 @@ class HtmlLogger (StandardLogger):
|
|||
urlData.name+"</td>\n</tr>\n")
|
||||
if urlData.parentName and self.has_field("parenturl"):
|
||||
self.fd.write("<tr>\n<td>"+self.field("parenturl")+
|
||||
'</td>\n<td><a target="top" href="'+urlData.parentName+'">'+
|
||||
urlData.parentName+"</a>")
|
||||
'</td>\n<td><a target="top" href="'+
|
||||
quote(urlData.parentName)+'">'+urlData.parentName+"</a>")
|
||||
if urlData.line:
|
||||
self.fd.write(i18n._(", line %d")%urlData.line)
|
||||
if urlData.column:
|
||||
|
|
@ -93,7 +94,7 @@ class HtmlLogger (StandardLogger):
|
|||
urlData.baseRef+"</td>\n</tr>\n")
|
||||
if urlData.url and self.has_field("realurl"):
|
||||
self.fd.write("<tr>\n<td>"+self.field("realurl")+"</td>\n<td>"+
|
||||
'<a target="top" href="'+urlData.url+
|
||||
'<a target="top" href="'+quote(urlData.url)+
|
||||
'">'+urlData.url+"</a></td>\n</tr>\n")
|
||||
if urlData.dltime>=0 and self.has_field("dltime"):
|
||||
self.fd.write("<tr>\n<td>"+self.field("dltime")+"</td>\n<td>"+
|
||||
|
|
|
|||
Loading…
Reference in a new issue