[pmwiki-users] Ingredients . . .
Patrick R. Michaud
pmichaud at pobox.com
Tue Feb 7 08:49:13 CST 2006
On Tue, Feb 07, 2006 at 03:18:51PM +0100, Dominique Faure wrote:
> 2006/2/7, Patrick R. Michaud <pmichaud at pobox.com>:
> > What should we name this function? (Coming up with good function
> > and variable names is always the hardest part of programming... :-)
> ResolveLink ?
> My current way of dealing with (url|intermap|attachment)s? is to write
> something like:
> # $arg is the reference given in the markup argument
> $f = MakeLink($pagename, $arg, NULL, NULL, '$LinkUrl');
> if(strrpos($f, 'action=approvesites') !== false) return Keep($f);
> # do what you want with $f
> The (kludgy) test is here to catch unapproved urls. In this case, the
> markup should render as an unapproved link only.
Yes, and the test will fail if a site changes ?action=approvesites
to be ?action=approveurls instead.
At the moment I don't have a good general solution for this problem,
but I'm thinking that I should perhaps configure things so that
an unapproved (or invalid) target passed to MakeLink results in
$LinkUrl being an empty string.
More information about the pmwiki-users