]> git.andy128k.dev Git - ipf.git/commitdiff
admin pages: fix 404
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 27 Oct 2013 20:48:36 +0000 (22:48 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 27 Oct 2013 20:48:36 +0000 (22:48 +0200)
ipf/admin/views.php

index b47407070bbfe6ef19e8d4e340d7f31980fd99e0..c7b87cc1b7c92d8ce2ff8c668d17547a2bb9c2d3 100644 (file)
@@ -121,6 +121,8 @@ function IPF_Admin_Views_EditItem($request, $match)
         $ma = IPF_Admin_Model::getModelAdmin($m);
         if ($ma !== null) {
             $item = IPF_ORM::getTable($m)->find($id);
+            if (!$item)
+                throw new IPF_HTTP_Error404();
             return $ma->EditItem($request, $lapp, $lmodel, $item);
         }
     }
@@ -150,6 +152,8 @@ function IPF_Admin_Views_DeleteItem($request, $match)
         {
             $o = new $m();
             $item = $o->getTable()->find($id);
+            if (!$item)
+                throw new IPF_HTTP_Error404();
             
             return $ma->DeleteItem($request, $lapp, $lmodel, $item);
         }