[ mailman-Bugs-1196085 ] Utils.ScriptURL() doesn't generate relative URLs

SourceForge.net noreply at sourceforge.net
Thu May 5 19:55:19 CEST 2005


Bugs item #1196085, was opened at 2005-05-05 17:55
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=1196085&group_id=103

Category: Web/CGI
Group: 2.1 (stable)
Status: Open
Resolution: None
Priority: 5
Submitted By: dwpoon (dwpoon)
Assigned to: Nobody/Anonymous (nobody)
Summary: Utils.ScriptURL() doesn't generate relative URLs

Initial Comment:
In Utils.py, function ScriptURL takes a boolean
argument called "absolute".  When it's False, the
function is supposed to return the target URL relative
to the URL of the currently executing CGI.  However, a
logic bug prevents it from doing that.

See the attached patch for the correction.  (Patch is
against version 2.1.6rc3.)

Explanation:
fullpath is the URL-path of the current CGI, e.g.
'/mailman/create'.
baseurl is something like '/mailman/'.
Therefore, it makes sense to return a relative URL
whenever fullpath STARTSwith baseurl.

This fix is important because without the ability to
generate relative URLs, the UI will always tend towards
using HTTP or HTTPS (whichever happens to be specified
in web_page_url).  It would be nice if it would
continue using whichever protocol was already in use.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=1196085&group_id=103


More information about the Mailman-coders mailing list