1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 12:05:55 +00:00

opml host, update: use PDO

This commit is contained in:
Andrew Dolgov
2017-12-02 11:42:42 +03:00
parent f8108cc28d
commit a77a47332c
2 changed files with 46 additions and 31 deletions

View File

@@ -15,14 +15,16 @@
$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->opml_export("", $owner_uid, true, false);