New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Feature Proposal: Un-deprecate Foswiki::Func::getScriptUrlPath() API


To complement Foswiki::Func::getScriptUrl().

It seems madness that we have to reverse-engineer the path from a full absolute URL; this is error-prone, and wasted CPU cycles.

Description and Documentation

To work exactly as Foswiki::Func::getScriptUrl(), only return the (absolute) path part of the URL (i.e. without protocol/authority/hostname).

Actually, I really don't like Foswiki::Func::getScriptUrl() - it should go ($script, $web, $topic) or even just ($script) - but it's not enough to create inconsistency.


my $path = Foswiki::Func::getScriptUrlPath();




-- Contributors: PaulHarvey - 17 Dec 2011


The rationale for this deprecation was:
*WARNING:* you are strongly recommended *not* to use this function, as the {ScriptUrlPaths} URL rewriting rules will not apply to urls generated using it.
and is documented in However this change was reverted and the deprecation should have been reverted at the same time - it is a testament to the deprecation that this is only being raised again now, 6 years later.

Changed decision to "14 days later" as it cannot be "Under Construction" before it is "Accepted".

-- CrawfordCurrie - 17 Feb 2012

Oops, wrong button. This was MergedToCore.

-- PaulHarvey - 17 Feb 2012
Topic revision: r4 - 17 Feb 2012, PaulHarvey - This page was cached on 22 Mar 2018 - 09:05.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License