public: fix share() returning random unshared articles if uuid is not given
This commit is contained in:
parent
088fcf8131
commit
ea30061cce
|
@ -298,23 +298,25 @@ class Handler_Public extends Handler {
|
||||||
function share() {
|
function share() {
|
||||||
$uuid = clean($_REQUEST["key"]);
|
$uuid = clean($_REQUEST["key"]);
|
||||||
|
|
||||||
$sth = $this->pdo->prepare("SELECT ref_id, owner_uid FROM ttrss_user_entries WHERE
|
if ($uuid) {
|
||||||
uuid = ?");
|
$sth = $this->pdo->prepare("SELECT ref_id, owner_uid
|
||||||
$sth->execute([$uuid]);
|
FROM ttrss_user_entries WHERE uuid = ?");
|
||||||
|
$sth->execute([$uuid]);
|
||||||
|
|
||||||
if ($row = $sth->fetch()) {
|
if ($row = $sth->fetch()) {
|
||||||
header("Content-Type: text/html");
|
header("Content-Type: text/html");
|
||||||
|
|
||||||
$id = $row["ref_id"];
|
$id = $row["ref_id"];
|
||||||
$owner_uid = $row["owner_uid"];
|
$owner_uid = $row["owner_uid"];
|
||||||
|
|
||||||
print $this->format_article($id, $owner_uid);
|
print $this->format_article($id, $owner_uid);
|
||||||
|
|
||||||
} else {
|
return;
|
||||||
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
|
}
|
||||||
print "Article not found.";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
|
||||||
|
print "Article not found.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private function get_article_image($enclosures, $content, $site_url) {
|
private function get_article_image($enclosures, $content, $site_url) {
|
||||||
|
|
Loading…
Reference in New Issue