feedbrowser: fix incorrect usage of LIMIT in prepared statement

This commit is contained in:
Andrew Dolgov 2018-06-18 23:50:32 +03:00
parent 149e903dd1
commit d00d515320
1 changed files with 4 additions and 4 deletions

View File

@ -24,8 +24,8 @@
(SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
WHERE tf.feed_url = qqq.feed_url WHERE tf.feed_url = qqq.feed_url
AND owner_uid = ?) $search_qpart AND owner_uid = ?) $search_qpart
GROUP BY feed_url, site_url, title ORDER BY subscribers DESC LIMIT ?"); GROUP BY feed_url, site_url, title ORDER BY subscribers DESC LIMIT " . (int)$limit);
$sth->execute([$_SESSION['uid'], $limit]); $sth->execute([$_SESSION['uid']]);
} else if ($mode == 2) { } else if ($mode == 2) {
$sth = $pdo->prepare("SELECT *, $sth = $pdo->prepare("SELECT *,
@ -38,9 +38,9 @@
WHERE ttrss_feeds.feed_url = ttrss_archived_feeds.feed_url AND WHERE ttrss_feeds.feed_url = ttrss_archived_feeds.feed_url AND
owner_uid = :uid) = 0 AND owner_uid = :uid) = 0 AND
owner_uid = :uid $search_qpart owner_uid = :uid $search_qpart
ORDER BY id DESC LIMIT :limit"); ORDER BY id DESC LIMIT " . (int)$limit);
$sth->execute([":uid" => $_SESSION['uid'], ":limit" => $limit]); $sth->execute([":uid" => $_SESSION['uid']]);
} }
$feedctr = 0; $feedctr = 0;