[pmwiki-devel] stripmagic

Patrick R. Michaud pmichaud at pobox.com
Thu Dec 28 11:08:18 CST 2006

On Sat, Dec 23, 2006 at 09:49:31AM -0500, Henrik wrote:
> Patrick,
> I'm having a magic_quotes_gpc problem:
> I'm writing an enhanced version of IncludeText() (based on 2.1.26 for 
> now), using
> Markup('includepage', '>if',
>   '/\\(:includepage\\s+(\\S.*?):\\)/ei',
>   "PRR(IncludePageText(\$pagename, '$1'))");

Actually, this has nothing to do with magic_quotes_gpc.
The /e option always adds backslashes in front of quotes
in the matched text, so you need to be using PSS('$1')
instead of '$1' in the above.  Thus:

  Markup('includepage', '>if',
    "PRR(IncludePageText(\$pagename, PSS('$1')))");

(The PSS() helper function removes any backslashes introduced
by the /e option.)

Hope this helps,


More information about the pmwiki-devel mailing list