fix validation of emails

This commit is contained in:
Uwe Steinmann 2021-06-21 18:09:59 +02:00
parent 525b6d45c9
commit 369497ee3a
2 changed files with 3 additions and 1 deletions

View File

@ -1233,7 +1233,8 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
break;
case self::type_email:
foreach($values as $value) {
$success &= preg_match('/^[a-z0-9._-]+@+[a-z0-9._-]+\.+[a-z]{2,4}$/i', $value);
$success &= filter_var($value, FILTER_VALIDATE_EMAIL);
//preg_match('/^[a-z0-9._-]+@+[a-z0-9._-]+\.+[a-z]{2,63}$/i', $value);
}
if(!$success)
$this->_validation_error = 5;

View File

@ -28,6 +28,7 @@
- add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers()
- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog()
- better handling of document with an empty workflow state
- fix checking of email addresses by using filter_var instead of regex
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">