HTTPResponse.insertBase does not detect multiline base tags

Bug #143793 reported by Stefan Bunse
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Low
Unassigned

Bug Description

My PageTemplates generate a multiline base tag which is not detected by the HTTPResponse so it adds a second base tag which in turn is invalid xhtml.

the corresponding regex is in ZPublisher.HTTPResponse, line 474:

  base_re_search=re.compile('(<base.*?>)',re.I).search

to make it detect my multiline base tag i changed it to:

  base_re_search=re.compile('(<base[^>]*?>)',re.I|re.M).search

and it works.

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

Why do you have to generate the BASE tag on your own. There is usually absolutely no need to do anything with the BASE tag. This is up to Zope!

Revision history for this message
Stefan Bunse (sbunse) wrote :

my main template contains the navigation (with flash movies) and an iframe tag which loads the actual content. to make all links target the iframe i want to send <base href="#" target="content-frame" />.
but i found no (clean) way to make tal render the whole tag on one line and imho it's valid (x)html to spread a base tag over multiple lines.

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

Changes: submitter email, edited transcript, importance (medium => low)

Revision history for this message
Tres Seaver (tseaver) wrote :

Changes: topic (ZServer => Zope), new comment

This bug is related to ZPublisher, not ZServer.

Changed in zope2:
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
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.