[Checkins] SVN: Zope/trunk/lib/python/Products/PageTemplates/utils.py LP/#324876: tighened regex for detecing the charset

Andreas Jung andreas at andreas-jung.com
Wed Feb 4 05:56:36 EST 2009


Log message for revision 96068:
  LP/#324876: tighened regex for detecing the charset
  from a meta-equiv header
  

Changed:
  U   Zope/trunk/lib/python/Products/PageTemplates/utils.py

-=-
Modified: Zope/trunk/lib/python/Products/PageTemplates/utils.py
===================================================================
--- Zope/trunk/lib/python/Products/PageTemplates/utils.py	2009-02-04 10:24:21 UTC (rev 96067)
+++ Zope/trunk/lib/python/Products/PageTemplates/utils.py	2009-02-04 10:56:35 UTC (rev 96068)
@@ -18,9 +18,8 @@
 
 import re 
 
-
 xml_preamble_reg = re.compile(r'^<\?xml.*?encoding="(.*?)".*?\?>', re.M)
-http_equiv_reg = re.compile(r'(<meta.*?http\-equiv.*?content-type.*?>)', re.I|re.M|re.S)
+http_equiv_reg = re.compile(r'(<meta\s+[^>]*?http\-equiv[^>]*?content-type.*?>)', re.I|re.M|re.S)
 http_equiv_reg2 = re.compile(r'charset.*?=.*?(?P<charset>[\w\-]*)', re.I|re.M|re.S)
 
 def encodingFromXMLPreamble(xml):



More information about the Checkins mailing list