Fixed possible fatal error in the Wiki.

The error could be triggered only when playing with the URL manually.
This commit is contained in:
Loic d'Anterroches 2008-11-30 11:18:58 +01:00
parent 57a4ea7cb0
commit 2732da9dbb
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ class IDF_Middleware
try {
$request->project = IDF_Project::getOr404($match[1]);
} catch (Pluf_HTTP_Error404 $e) {
return new Pluf_HTTP_Response_NotFound(sprintf(__('The page <em>%s</em> was not found on the server.'), htmlspecialchars($request->query)));
return new Pluf_HTTP_Response_NotFound($request);
}
$request->conf = new IDF_Conf();
$request->conf->setProject($request->project);

View File

@ -216,7 +216,7 @@ class IDF_Views_Wiki
array($prj->id, $match[2]));
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
if ($pages->count() != 1) {
throw new Pluf_HTTP_Error404($request);
throw new Pluf_HTTP_Response_NotFound($request);
}
$page = $pages[0];
$oldrev = false;
@ -225,7 +225,7 @@ class IDF_Views_Wiki
$oldrev = Pluf_Shortcuts_GetObjectOr404('IDF_WikiRevision',
$request->GET['rev']);
if ($oldrev->wikipage != $page->id or $oldrev->is_head == true) {
throw new Pluf_HTTP_Error404($request);
throw new Pluf_HTTP_Response_NotFound($request);
}
}
$ptags = self::getWikiTags($prj);