00184: ReadPage() returns data in case of error

Summary: ReadPage() returns data in case of error
Created: 2004-11-27 19:26
Status: Closed
Category: Bug
From: Balu
Priority: 5
Version: cvs

Description: ReadPage() always returns an array containing 'time', even if the page itself could not be loaded.

This breaks code that checks if the page gets loaded using e.g.:

  $page = ReadPage($p);
  if (!$page) return;

You'd probably want to return false if the page could not be loaded, so ReadPage() should be extended by one line:

 if (@!$page) return false;


Actually, despite what the code would indicate, PmWiki's ReadPage function has always returned a $page structure, even if the page doesn't exist. So, I'm likely to leave it as-is for now. --Pm