Bad 'http_equiv_reg' in 'Products.PageTemplates.utils'

Bug #324876 reported by Dieter Maurer
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Medium
Unassigned

Bug Description

The regular expression definitions in "Products.PageTemplates.utils" are too wide to reliable detect a "<meta http-equiv="content-type" content="text/html; charset=..." />

Example breaking template:
<metal:master-macro define-macro="master">
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <html lang="de">

                <tal:defCharset define="dummy python: request.RESPONSE.setHeader('Content-Type','text/html;; charset=windows-1252');" />

                <tal:defAll
                        define="
                        ">

                        <head>
                                <title><tal:span content="here/properties/propPortalName" /></title>
                                <meta http-equiv="content-type" content="text/html; charset=windows-1252" />

Tags: 2.11.1 zope
Revision history for this message
Dieter Maurer (d.maurer) wrote :

Partial patch attached.

For a really robust solution, an HTML parser (rather than a regular expression) would be necessary.

Revision history for this message
Andreas Jung (ajung) wrote :

Fixed on the Zope 2.10, 2.11 branches and trunk

@Dieter: you have SVN *write* access *wink*

Changed in zope2:
importance: Undecided → Medium
status: New → Fix Committed
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.