[pmwiki-users] MarkupExpressionsExtensions

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 19 12:31:24 CDT 2007


On Wed, Apr 18, 2007 at 04:38:16PM -0400, The Editor wrote:
> Second post on a couple problems with the Markup Expressions
> Extensions recipe, I'd like to resolve...
> 
> On 4/16/07, The Editor <editor at fast.st> wrote:
> > In trying to finish up this recipe I came up with a bug...
> >
> >         if (! CondAuth($p, $HandleAuth['source'])) return '';
> >
> > seems to fail whether or not I have permission or not (defined in
> > config.php as admin.  $p appears to be the correct Group.Name value.  Help?
> 
> It's supposed to return a blank if the user is not authorized to see
> the source of page $p. Otherwise it continues on in the routine.

There's not nearly enough information here to give a useful
answer.  Is this inside of a function; if so, has $HandleAuth
been declared global?  Is this code perhaps being executed before
$HandleAuth['source'] is being set?  Can we see the code that
is setting $HandleAuth['source'] and then passing control to
this statement?

> > Also, this does not work at all...  I had this problem before and
> > never figured it out.  The problem is the $p value even
> > though it shows up as expected, the strpos cannot find a " " in it, so
> > it can't make the test or return the right value
> >
> > $MarkupExpr['wiki'] = 'MkExpExtWiki($params)';

In the comments at the top of markupexpr.php, it reads:

    Finally, if the code in $MarkupExpr contains '$params', then
    it is executed directly without any preprocessing into arguments,
    and $params contains the entire argument string.  Note that $params
    may contain escaped values representing quoted arguments and
    results of other expressions; these values may be un-escaped
    by using "preg_replace($rpat, $rrep, $params)".

> This is supposed to work for {(wiki pagelist group=Test)}, changing it
> to (:pagelist group=Test:).  Also any thoughts Pm on escaping this on
> the word pagelist when it saves as you mentioned earlier?

At present I don't have any plans to change the way that PmWiki
escapes (:pagelist ...:) in the core.

Pm



More information about the pmwiki-users mailing list