diff --git a/plugins/embed_original/init.php b/plugins/embed_original/init.php index a74905f8..1925d141 100644 --- a/plugins/embed_original/init.php +++ b/plugins/embed_original/init.php @@ -1,5 +1,7 @@ pdo->prepare("SELECT link FROM ttrss_entries, ttrss_user_entries - WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']); - - $url = ""; - - if (db_num_rows($result) != 0) { - $url = db_fetch_result($result, 0, "link"); + WHERE id = ? AND ref_id = id AND owner_uid = ?"); + $sth->execute([$id, $_SESSION['uid']]); + if ($row = $sth->fetch()) { + $url = $row['link']; + } else { + $url = ""; } print json_encode(array("url" => $url, "id" => $id));