Commit bcd1c34b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5292 Refuse non-array values for multivaluated attributes (should only concern webservice)

Showing with 3 additions and 0 deletions
+3 -0
...@@ -132,6 +132,9 @@ class SetAttribute extends Attribute ...@@ -132,6 +132,9 @@ class SetAttribute extends Attribute
if (!empty($error) || ($this->attribute === FALSE)) { if (!empty($error) || ($this->attribute === FALSE)) {
return $error; return $error;
} else { } else {
if (!is_array($this->value)) {
return sprintf(_('The value for multivaluated field "%s" is not an array'), $this->getLabel());
}
foreach ($this->value as $value) { foreach ($this->value as $value) {
$this->attribute->setValue($value); $this->attribute->setValue($value);
$error = $this->attribute->check(); $error = $this->attribute->check();
......
  • bmortier @bmortier

    mentioned in issue #1689

    By tbp on 2017-09-02T15:34:56 (imported from GitLab)

    ·

    mentioned in issue #1689

    By tbp on 2017-09-02T15:34:56 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment