svn: /pear/packages/Bugtracker/trunk/site/ patch-add.php

From: Date: Thu, 13 Aug 2009 14:26:56 +0000
Subject: svn: /pear/packages/Bugtracker/trunk/site/ patch-add.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-57122@lists.php.net to get a copy of this message
jani Thu, 13 Aug 2009 14:26:56 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=287237 Log: - Use common email validator function Changed paths: U pear/packages/Bugtracker/trunk/site/patch-add.php Modified: pear/packages/Bugtracker/trunk/site/patch-add.php =================================================================== --- pear/packages/Bugtracker/trunk/site/patch-add.php 2009-08-13 14:26:28 UTC (rev 287236) +++ pear/packages/Bugtracker/trunk/site/patch-add.php 2009-08-13 14:26:56 UTC (rev 287237) @@ -63,12 +63,11 @@ if (!$logged_in) { try { $errors = array(); - if (empty($_POST['email'])) { + + if (!is_valid_email($_POST['email'])) { $errors[] = 'Email address must be valid!'; } - if (!preg_match("/^[.\\w+-]+@[.\\w-]+\\.\\w{2,}\z/i",$_POST['email'])) { - $errors[] = 'Email address must be valid!'; - } + /** * Check if session answer is set, then compare * it with the post captcha value. If it's not @@ -79,6 +78,7 @@ $errors[] = 'Incorrect Captcha'; } } + if (count($errors)) { throw new Exception(''); }

« previous php.pear.cvs (#57122) next »