mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-18 15:00:28 +00:00
introduce MAX_NAMELEN
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2172 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
f40e41a5bb
commit
55cbb2f0a9
1 changed files with 3 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ import linkcheck.strformat
|
|||
import linkcheck.linkname
|
||||
import linkcheck.log
|
||||
|
||||
MAX_NAMELEN = 256
|
||||
|
||||
# ripped mainly from HTML::Tagset.pm
|
||||
LinkTags = {
|
||||
|
|
@ -191,9 +192,9 @@ class LinkFinder (TagFinder):
|
|||
name = linkcheck.strformat.unquote(attrs.get('title', u''))
|
||||
if not name:
|
||||
pos = self.parser.pos()
|
||||
# Look for name only up to characters from current
|
||||
# Look for name only up to MAX_NAMELEN characters from current
|
||||
# position, to limit the amount of data to encode.
|
||||
data = self.content[pos:pos+500]
|
||||
data = self.content[pos:pos+MAX_NAMELEN]
|
||||
data = data.decode(self.parser.encoding, "ignore")
|
||||
name = linkcheck.linkname.href_name(data)
|
||||
elif tag == 'img':
|
||||
|
|
|
|||
Loading…
Reference in a new issue