setRegex() checks regex only if not ''

This commit is contained in:
Uwe Steinmann 2021-09-16 17:10:41 +02:00
parent f1db74929c
commit 16da190e06

View File

@ -803,7 +803,7 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
$db = $this->_dms->getDB();
$regex = trim($regex);
if(@preg_match($regex, '') === false)
if($regex && @preg_match($regex, '') === false)
return false;
$queryStr = "UPDATE `tblAttributeDefinitions` SET `regex` =".$db->qstr($regex)." WHERE `id` = " . $this->_id;