mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
validate() is less strict on multi value attributes
if the attribute has just one value the leading separator can be omitted
This commit is contained in:
parent
7d7bff7b22
commit
046f33f2e1
|
@ -917,9 +917,14 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
||||||
*/
|
*/
|
||||||
function validate($attrvalue) { /* {{{ */
|
function validate($attrvalue) { /* {{{ */
|
||||||
if($this->getMultipleValues()) {
|
if($this->getMultipleValues()) {
|
||||||
if(is_string($attrvalue))
|
if(is_string($attrvalue)) {
|
||||||
$values = explode($attrvalue[0], substr($attrvalue, 1));
|
$sep = $attrvalue[0];
|
||||||
else
|
$vsep = $this->getValueSetSeparator();
|
||||||
|
if($sep == $vsep)
|
||||||
|
$values = explode($attrvalue[0], substr($attrvalue, 1));
|
||||||
|
else
|
||||||
|
$values = array($attrvalue);
|
||||||
|
} else
|
||||||
$values = $attrvalue;
|
$values = $attrvalue;
|
||||||
} else {
|
} else {
|
||||||
$values = array($attrvalue);
|
$values = array($attrvalue);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user