Permalink
Browse files

For consistency, use straight Kohana_404_Exception instead of the eve…

…nt system.
  • Loading branch information...
1 parent d53f6d0 commit 7e47c3b19f522344f7083ea0bd9524bfff1a0eb2 @andyst andyst committed Feb 13, 2010
@@ -26,7 +26,7 @@ public function show($album) {
if (!is_object($album)) {
// show() must be public because we route to it in url::parse_url(), so make
// sure that we're actually receiving an object
- Event::run('system.404');
+ throw new Kohana_404_Exception();
}
access::required("view", $album);
@@ -21,7 +21,7 @@ class Items_Controller extends Controller {
public function __call($function, $args) {
$item = ORM::factory("item", (int)$function);
if (!$item->loaded()) {
- Event::run('system.404');
+ throw new Kohana_404_Exception();
}
// Redirect to the more specific resource type, since it will render
@@ -22,7 +22,7 @@ public function show($movie) {
if (!is_object($movie)) {
// show() must be public because we route to it in url::parse_url(), so make
// sure that we're actually receiving an object
- Event::run('system.404');
+ throw new Kohana_404_Exception();
}
access::required("view", $movie);
@@ -22,7 +22,7 @@ public function show($photo) {
if (!is_object($photo)) {
// show() must be public because we route to it in url::parse_url(), so make
// sure that we're actually receiving an object
- Event::run('system.404');
+ throw new Kohana_404_Exception();
}
access::required("view", $photo);
@@ -120,7 +120,7 @@ static function required($perm_name, $item) {
if (!self::can($perm_name, $item)) {
if ($perm_name == "view") {
// Treat as if the item didn't exist, don't leak any information.
- Event::run('system.404');
+ throw new Kohana_404_Exception();
} else {
self::forbidden();
}

0 comments on commit 7e47c3b

Please sign in to comment.