From fad986ff5d3a80a1c9d57e90c6e1cc39df5dc9be Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 3 Dec 2017 10:58:13 +0300 Subject: [PATCH] plugins/embed_original: use PDO --- plugins/embed_original/init.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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)); -- 2.39.5