Check if you can use the Symphony validation classes. I've used them in the CommentController to validate a new comment.