Comment 0 for bug 266231

Revision history for this message
Dwpoon (dwpoon) wrote :

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.

[http://sourceforge.net/tracker/index.php?func=detail&aid=1196085&group_id=103&atid=100103]