pombreda / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

Parsing fix #236

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There was either a parsing or performance issue I fixed with this particular 
patch.  Sadly I don't have any test cases anymore.  All I remember that this 
change was very important.

*** feedparser.py.orig  2009-02-28 21:52:31.000000000 -0800
--- feedparser.py       2009-08-04 14:44:26.000000000 -0700
***************
*** 2475,2481 ****

          # gauntlet
          if not re.match("""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$""", style): return ''
!         if not re.match("^(\s*[-\w]+\s*:\s*[^:;]*(;|$))*$", style): return ''

          clean = []
          for prop,value in re.findall("([-\w]+)\s*:\s*([^:;]*)",style):
--- 2553,2559 ----

          # gauntlet
          if not re.match("""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$""", style): return ''
!         if not re.match("^(\s*[-\w]+\s*:\s*[^:;]*(;|$))*\s*$", style): return 
''

          clean = []
          for prop,value in re.findall("([-\w]+)\s*:\s*([^:;]*)",style):

Original issue reported on code.google.com by EpsilonP...@hotmail.com on 3 Dec 2010 at 10:41

GoogleCodeExporter commented 9 years ago
Please close this bug as invalid.

I tested the proposed patch using svn trunk and the unit tests hung. After five 
minutes I had to kill the process.

Original comment by kurtmckee on 4 Dec 2010 at 4:14

GoogleCodeExporter commented 9 years ago
I remember the bug this patch is meant to fix. It was a very nasty problem with 
CSS sanitisation and regexp backtracking. It was fixed as 
http://code.google.com/p/feedparser/issues/detail?id=146

Original comment by adewale on 4 Dec 2010 at 10:32