[Zope] BASE tag on File objects

Jon Prettyman jprettyman@acm.org
29 Mar 2000 00:11:57 +0000


I've got a number of static HTML files on my site that Zope keeps
putting BASE tags into.  IMHO, it is inadvertantly appending a slash
onto the end of the HREF.  For example a file called default.htm in
the classified directory ends up with a base tag of:
  <base
href="http://www.nationalmortgagenews.com/classified/default.htm/">

I would think this should be:
  <base
href="http://www.nationalmortgagenews.com/classified/default.htm">

So I have modified: OFS.Image.File.index_html to strip the trailing
slash by adding:
        # clean up the base if neccessary
        if( RESPONSE.base[-1:] == '/' ):
            RESPONSE.base = RESPONSE.base[:-1]

What think you?

-Jon