From 2e4ce84cbdeb00bf85da6d40e5723517e52b8a97 Mon Sep 17 00:00:00 2001 From: Laurent Eschenauer Date: Tue, 10 Aug 2010 12:53:21 +0200 Subject: [PATCH] Fix issue #74 - Name can contain spaces when commenting --- .../application/public/controllers/CommentsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protected/application/public/controllers/CommentsController.php b/protected/application/public/controllers/CommentsController.php index 70c01a7..4dfee3a 100644 --- a/protected/application/public/controllers/CommentsController.php +++ b/protected/application/public/controllers/CommentsController.php @@ -131,7 +131,7 @@ public function addAction() { // Validate the website URL $matches = array(); - if (!preg_match_all("/^http/", $website, $matches)) { + if ($website && !preg_match_all("/^http/", $website, $matches)) { $website = "http://$website"; } @@ -212,7 +212,7 @@ private function getForm($source_id=0, $item_id=0) { // Create and configure username element: $name = $form->createElement('text', 'name', array('label' => 'Name:', 'decorators' => $form->elementDecorators)); $name->addFilter('StringToLower'); - $name->addValidator('alnum'); + $name->addFilter('StripTags'); $name->addValidator('stringLength', false, array(4, 20)); $name->setRequired(true);