[pmwiki-users] How can I check if a page exists

Carlos AB cabsec.pmwiki at gmail.com
Mon Feb 21 12:47:28 CST 2011


Hi list,

How can I check if a page exists inside a action handler? I need that
because i don't want a action handler to run if a page doesn't exist,
but using RetrieveAuthPage it seems that the action is not aborted
when a page is not found.

code:

function HandleXmlExport($pagename,$auth='read'){
  global $XmlExportXml,$XmlExportHeaders;

  $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
  if(!$page) Abort("Insufficient permissions");

...



More information about the pmwiki-users mailing list