fix: [API] toggle warninglists now correctly handles name lists as parameters instead of just single values, fixes #3706

pull/3711/head
iglocska 2018-09-25 08:18:39 +02:00
parent 0642c1aa84
commit c16c5ea171
1 changed files with 2 additions and 1 deletions

View File

@ -139,12 +139,13 @@ class WarninglistsController extends AppController
} else if (!empty($this->request->data['name'])) {
if (!is_array($this->request->data['name'])) {
$names = array($this->request->data['name']);
} else {
$names = $this->request->data['name'];
}
$conditions = array();
foreach ($names as $k => $name) {
$conditions['OR'][] = array('LOWER(Warninglist.name) LIKE' => strtolower($name));
}
$id = $this->Warninglist->find('list', array(
'conditions' => $conditions,
'recursive' => -1,