[pmwiki-users] variable returns domain name?
Patrick R. Michaud
pmichaud at pobox.com
Sat Apr 14 08:44:29 CDT 2007
On Sat, Apr 14, 2007 at 02:38:42PM +0200, christian.ridderstrom at gmail.com wrote:
> On Fri, 13 Apr 2007, Patrick R. Michaud wrote:
>
> >>Is there such a animal, and if not is it possible to create a custom
> >>one?
> >
> >$FmtPV['$SiteDomain'] =
> > "'" . preg_replace('!^\\w+://(www\.)?!', '', \$ScriptUrl) . "'";
> >
> >After this you can use {$SiteDomain} to get the site's domain name
> >stripped of any leading "www." .
>
> Just a comment that the above does not work if you've set $ScriptUrl to
> e.g. '/'. (Or have we said that $ScritpUrl is always a full/complete
> URI?)
$ScriptUrl must always be a complete uri. If it's set to a relative
uri reference, then PmWiki produces incomplete references in
redirects, RSS feeds, various forms, and a few other places.
I'm currently looking into the possibility of getting PmWiki to
automatically produce relative urls where it's safe to do so [1].
But PmWiki's "official" stance is that $ScriptUrl must be a
complete uri in order for everything to work.
Pm
[1] http://article.gmane.org/gmane.comp.web.wiki.pmwiki.user/40570
More information about the pmwiki-users
mailing list