Simplify the code / check number of parameters in mergeConditions

2022.09-rc
Michael 2020-09-06 20:28:08 +00:00
rodzic 8d0d6bcd0c
commit 4852458645
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -669,6 +669,10 @@ class DBA
*/
public static function mergeConditions(array ...$conditions)
{
if (count($conditions) == 1) {
return current($conditions);
}
$conditionStrings = [];
$result = [];

Wyświetl plik

@ -201,11 +201,7 @@ class Item
return [];
}
if (!empty($condition)) {
$condition = DBA::mergeConditions(['iid' => $pinned], $condition);
} else {
$condition = ['iid' => $pinned];
}
$condition = DBA::mergeConditions(['iid' => $pinned], $condition);
return self::selectThreadForUser($uid, $selected, $condition, $params);
}