[pmwiki-devel] Safe way to take a page name as an argument in Markup

Randy Brown randy at brownragfilms.com
Sun Jan 24 17:14:46 CST 2010


So how would I insert the name pattern into

Markup('mydirective', 'directives',
  '/\\(:mydirective (\\d+):\\)/e',
  "mydirective('$1')");

I assume the "(\\d+)" has to be replaced. I've tried to do that with many variations, without success.

Randy


On Jan 24, 2010, at 2:24 AM, Peter Bowers wrote:

> On Sun, Jan 24, 2010 at 6:55 AM, Randy Brown <randy at brownragfilms.com> wrote:
> I assume there is a way for my directive to support any page name without introducing a security hole. I probably only need to support a page Name, rather than Group.Name, but for future reference it would be good to know how to support either.
> 
> from pmwiki.php ResolvePageName():
> 
> "/^($GroupPattern)[.\\/]($NamePattern)$/i"
> 
> $GroupPattern and $NamePattern are defined as this:
> 
> $GroupPattern = '[[:upper:]][\\w]*(?:-\\w+)*';
> $NamePattern = '[[:upper:]\\d][\\w]*(?:-\\w+)*';
> 
> -Peter 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20100124/a5faabbd/attachment.html 


More information about the pmwiki-devel mailing list