[pmwiki-users] Redirect after $EditFunctions ?

Peter Bowers pbowers at pobox.com
Wed Jan 13 03:07:59 CST 2010

On Wed, Jan 13, 2010 at 12:58 AM, SteP <step.list+pmwiki at gmail.com> wrote:
> In php I need to redirect after the page is successfully posted. What's the right way to do it?
> Even if I place $EditFunctions[] = 'MyRedirect' as the very last line in config.php, I find that
> 'PostPageIndex' is still appended after MyRedirect (in pagelist.php), so MyRedirect can't call exit().
> Is there a way to ensure that MyRedirect hooks as the very last $EditFunction? Or to rearrange
> $EditFunctions from within MyRedirect, so that all functions following MyRedirect still get their
> chance to run?  Thanks in advance

You can't change the order in the middle of processing $EditFunctions
because it is processed in a foreach loop.  So you need to get it set
up ahead of time.

Basically what this means is including pagelist.php within your
config.php and then adding your MyRedirect *after* you do that.
(You'll probably want to set $EnablePageList to false as well -- I
think the include_once() would graciously deal with it, but better
safe than sorry.)

No guarantees it'll work, but hopefully it'll get you on the right road.


More information about the pmwiki-users mailing list