[pmwiki-users] forumstyled recipe apostophes in new topic

marc gmane at auxbuss.com
Wed Oct 25 13:07:42 CDT 2006


With the forumstyled recipe, I noticed a problem when adding topics with 
an apostrophe in their name.

The markup 


kicks off the handle

  function HandleNewTopic($pagename) {
    #strip any group from name, restricts topic pages to be in the same 
  $_REQUEST['name'] = preg_replace('/^.*[\\/.]/', '', $_REQUEST

which is fine, but since an apostrophe arrives like so,

  Marc's test -> Marc\\'s test

this messes things up a bit, as the topic displays as:

  Marc S Test

So, I tried the following on entry to HandleNewTopic as a quick fix:

  $_REQUEST['name'] = preg_replace('/\\\\\'/', '', $_REQUEST['name']);

to return

  Marcs Test

There will be similar problems with '?', etc.


More information about the pmwiki-users mailing list