[pmwiki-users] Creating a new page with GET/POST variables (or

sti at pooq.com sti at pooq.com
Fri Nov 9 15:21:06 CST 2007

Hans wrote:
> Friday, November 9, 2007, 8:35:24 PM, alglt at yahoo.com wrote:
>> So when the form is posted, the server at {$ScriptUrl} gets this:
>> action=edit&template=Blog.Template&pagename=Blog.This+is+a+test
> You can use a markup expression to turn the spaced title into a
> pagename (I use this method now in FoxForum).
> Markup expression 'wikiword' (Copyright D. Faure: Cookbook.MarkupExprPlus)
> This needs PmWiki 2.2.0 beta
> # for transforming author names into valid wiki words, with no spaces etc.;
> $MarkupExpr['wikiword'] =
> 'preg_replace(array_keys($GLOBALS["MakePageNamePatterns"]),'
>            . 'array_values($GLOBALS["MakePageNamePatterns"]),'
>            . 'preg_replace($rpat, $rrep, $params))';
> Then use it in your form to transform the string:
> (:input form "{$ScriptURL}":)
> (:input hidden action edit:)
> (:input hidden template Blog.Template:)
> (:input text pagename {(wikiword "Blog.This is a test")} :)
> (:input end:)
This can't possibly work. 'pagename' is an INPUT field. It can end up holding
absolutely anything. Passing the default value through wikiword won't fix that.

Doing some testing on my own site, this looks to be due to an actual error in
PmWiki's URL parsing. Specifically these work as expected:


But this doesn't:


I did a quick look through pmwiki.php, but I couldn't see any obvious place
where things could be going wrong.

More information about the pmwiki-users mailing list