Skip to content

Commit 44d3e51

Browse files
committed
Small fixes
#1964 (comment)
1 parent 6d1c0ea commit 44d3e51

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

p/api/fever.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,16 @@ public function findEntries(array $feed_ids, array $entry_ids, $max_id, $since_i
6969
if (!empty($entry_ids)) {
7070
$bindEntryIds = $this->bindParamArray('id', $entry_ids, $values);
7171
$sql .= " id IN($bindEntryIds)";
72-
} elseif ($max_id !== null) {
72+
} elseif ($max_id != null) {
7373
$sql .= ' id < :id';
7474
$values[':id'] = $max_id;
7575
$order = ' ORDER BY id DESC';
76-
} elseif ($since_id !== null) {
76+
} elseif ($since_id != null) {
7777
$sql .= ' id > :id';
7878
$values[':id'] = $since_id;
7979
$order = ' ORDER BY id ASC';
80+
} else {
81+
$sql .= ' 1=1';
8082
}
8183

8284
if (!empty($feed_ids)) {
@@ -472,15 +474,15 @@ protected function getItems()
472474
if (isset($_REQUEST['max_id'])) {
473475
// use the max_id argument to request the previous $item_limit items
474476
$max_id = '' . $_REQUEST['max_id'];
475-
if (!ctype_digit($max_id) || $max_id < 0) {
477+
if (!ctype_digit($max_id)) {
476478
$max_id = null;
477479
}
478480
} else if (isset($_REQUEST['with_ids'])) {
479481
$entry_ids = explode(',', $_REQUEST['with_ids']);
480482
} else {
481483
// use the since_id argument to request the next $item_limit items
482484
$since_id = '' . $_REQUEST['since_id'];
483-
if (!ctype_digit($since_id) || $since_id < 0) {
485+
if (!ctype_digit($since_id)) {
484486
$since_id = null;
485487
}
486488
}

0 commit comments

Comments
 (0)