[pmwiki-devel] Variable Expansion Question.

Patrick R. Michaud pmichaud at pobox.com
Tue Oct 23 12:58:28 CDT 2007


On Tue, Oct 23, 2007 at 08:31:44AM -0400, Stirling Westrup wrote:
> I'm wondering if anyone has any insight on how Pm avoids recursive loops in
> his variable expansion routines. I ask because I need to do something similar
> and my reading of the PmWiki code has given me no insight.

PmWiki handles this within PageTextVar() -- when performing a
substitution for {$$foo}, it first removes any instances of
{$$foo} from the replacement string.  This prevents any form of
self-recursion from taking place.

PmWiki doesn't handle the case of indirect recursion of page text
variables... but that doesn't seem to occur very often in normal
practice.

Pm



More information about the pmwiki-devel mailing list