[pmwiki-devel] stripmagic

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Fri Dec 29 05:07:43 CST 2006


On Thu, 28 Dec 2006, Patrick R. Michaud wrote:

> 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',
>    '/\\(:includepage\\s+(\\S.*?):\\)/ei',
>    "PRR(IncludePageText(\$pagename, PSS('$1')))");
>
> (The PSS() helper function removes any backslashes introduced by the /e 
> option.)

I checked pmwiki.org, and PSS() is documented here
 	http://pmwiki.org/wiki/PmWiki/Functions

with the following text:

 	PSS($string)

 	This function should always be used, passing parameters to
 	functions called via preg_replace. Especially when defining a
 	replacement with the Markup() function. It removes the escape in
 	front of quotation marks. This function is frequently used in
 	scripts/stdmarkup.php, for example in the definition of the
 	(:redirect:)-directive.

I found it slightly confusing... Maybe an example would clarify it?
(I've seen PSS() used quite often but never before understood when to 
use it).

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-devel mailing list