[pmwiki-users] Dealing with $ScriptUrl using a "local" path (Was: Wikipublisher..)

Patrick R. Michaud pmichaud at pobox.com
Thu Dec 21 08:31:01 CST 2006


On Thu, Dec 21, 2006 at 12:36:35PM +0100, christian.ridderstrom at gmail.com wrote:
> Hi John (and Patrick)
> 
> I'm sending this to Patrick as well as the list I think the solution 
> concerns PmWiki and possibly recipes in general.
> 
> On Thu, 21 Dec 2006, christian.ridderstrom at gmail.com wrote:
> 
> >I'm trying to install wiki publisher, but when trying to typeset a single 
> >page I run into problems:
> >
> >Clicking download results in this link:
> >
> >http://www.wikipublisher.org/cgi-bin/mkpdf.pl//~chr/test/pmwiki.php?a<snip>
> 						|
> 						`-- stuff missing!
> 
> I found the culprit. Wikipublisher uses $ScriptUrl for the URI to the 
> pdfserver (at wikipublisher.org). Since I had set $ScriptUrl like this:
> 
> 	$ScriptUrl = '/~chr/test/pmwiki.php';
> 
> the pdfserver has no idea from where I am coming. the quick fix is this:
> 
> 	$ScriptUrl = 'http://wiki.lyx.org/~chr/test/pmwiki.php';
> 
> However, I think I should be able to use a "local" $ScriptUrl?  

This is PITS #00526 (http://www.pmwiki.org/wiki/PITS/00526).

Setting $ScriptUrl to a relative url causes all sorts of problems.
There are some places that absolutely require a complete url
as opposed to a partial one -- the WikiPublisher example above
is one, but complete urls are needed in RSS feeds, for Redirect: 
headers, in order for some forms to work, when using a variety
of CleanUrl solutions, etc.

The mailing list has discussed the possibility of adding another
variable like $ScriptUrl that would allow absolute paths, but
we've never gone anywhere with it.  You might check the mailing
list archives and summarize where things stood.

The biggest objection I have to introducing another variable is
that it complicates site configuration even further.  And my
strong preference is that $ScriptUrl continue to be a complete
url, so as to keep existing scripts and sites working as they do now.

However, one possibility would be to leave $ScriptUrl as a
complete url, and introduce a new variable that strips off
any leading "http://..." or "https://..." to produce a
partial url.

Pm




More information about the pmwiki-users mailing list