[pmwiki-users] UpdatePage processing markup again

Peter & Melodye Bowers pbowers at pobox.com
Wed Apr 2 15:39:28 CDT 2008

I just discovered that one of the $EditFunctions within UpdatePage()
(SaveAttributes() to be specific) calls MarkupToHTML() as part of the
process of saving a page.

Obviously all markup expressions get processed along with all other markup
within MarkupToHTML().

My problem is in my specific situation I could very easily end up with a
race condition where PageA contains an MX that writes to PageB and PageB
contains an MX that writes to PageA.

I can either suppress writing to pages while an UpdatePage() is running.

Or I can simply stop all WikiSh functions from doing anything if an
UpdatePage() is running.

The completely "do-nothing-while-UpdatePage-is-running" solution is easier
to implement, but I don't know what implications this might have.  I'm
afraid SaveAttributes() gets into some stuff I haven't adequately explored
and I simply can't figure out what it's doing.  To be honest it looks like a
"write-only" setting of the $html variable, but maybe there's some PHP
subtlety that I'm not catching here...  (If it is "write only" there could
potentially be a noticeable performance gain by removing it...)

Also, is there any good, standard way to know whether I am in the context of
a page being posted or in a normal context?  Is there some global variable
or something that is set when a page is being posted that is not set
otherwise?  I tried $EnablePost but it seems to be set always...


More information about the pmwiki-users mailing list