Fix: always shows all positions (regression)

This commit is contained in:
Bartek Fabiszewski 2017-04-07 19:02:05 +02:00
parent 9fbf64563a
commit 6723a830c4

View File

@ -91,10 +91,10 @@ class uPosition {
public function getAll($userId = NULL, $trackId = NULL) {
$rules = [];
if (!empty($userId)) {
$rule[] = "p.user_id='" . self::$db->real_escape_string($userId) ."'";
$rules[] = "p.user_id='" . self::$db->real_escape_string($userId) ."'";
}
if (!empty($trackId)) {
$rule[] = "p.track_id='" . self::$db->real_escape_string($trackId) ."'";
$rules[] = "p.track_id='" . self::$db->real_escape_string($trackId) ."'";
}
if (!empty($rules)) {
$where = "WHERE " . implode(" AND ", $rules);