Commit: 49cbb521ba42745ec18bce5763a102434e626436

Author: alkemann | Date: 2009-11-17 20:30:59 +0100
added validation for paste saves
diff --git a/controllers/PastesController.php b/controllers/PastesController.php index a0b73d3..f814332 100644 --- a/controllers/PastesController.php +++ b/controllers/PastesController.php @@ -66,7 +66,8 @@ class PastesController extends \lithium\action\Controller { $paste = Paste::create(compact('author', 'language')); } else { $paste = Paste::create($this->request->data); - if ($paste->save()) { + if ($paste->validates() && $paste->save()) { + $this->redirect(array( 'controller' => 'pastes', 'action' => 'view', 'args' => array($paste->id) ));