X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=opml.php;h=bdee88e081694a516cc711290023b3a7d0e09854;hb=e2b8c9273e09091c235959c25d8e4d8122aa6ca8;hp=c8fbf1c394c20a0d32d44c762c7fac98351aa2a2;hpb=6322ac79a020ab584d412d782d62b2ee77d7c6cf;p=tt-rss.git diff --git a/opml.php b/opml.php index c8fbf1c3..bdee88e0 100644 --- a/opml.php +++ b/opml.php @@ -10,23 +10,23 @@ require_once "db.php"; require_once "db-prefs.php"; - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); - if (!init_plugins()) return; $op = $_REQUEST['op']; if ($op == "publish"){ - $key = db_escape_string( $_REQUEST["key"]); + $key = $_REQUEST["key"]; + $pdo = Db::pdo(); - $result = db_query( "SELECT owner_uid + $sth = $pdo->prepare( "SELECT owner_uid FROM ttrss_access_keys WHERE - access_key = '$key' AND feed_id = 'OPML:Publish'"); + access_key = ? AND feed_id = 'OPML:Publish'"); + $sth->execute([$key]); - if (db_num_rows($result) == 1) { - $owner_uid = db_fetch_result($result, 0, "owner_uid"); + if ($row = $sth->fetch()) { + $owner_uid = $row['owner_uid']; - $opml = new Opml( $_REQUEST); + $opml = new Opml($_REQUEST); $opml->opml_export("", $owner_uid, true, false); } else { @@ -34,6 +34,4 @@ } } - db_close(); - ?>