X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=blobdiff_plain;f=opml.php;h=bdee88e081694a516cc711290023b3a7d0e09854;hp=b8c9fb6c5c483dd6d9ebc52bb89f444252f85399;hb=HEAD;hpb=6ef8ec84cb66b053edf84e8738a04089f8ca1b07 diff --git a/opml.php b/opml.php index b8c9fb6c..bdee88e0 100644 --- a/opml.php +++ b/opml.php @@ -2,6 +2,7 @@ set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . get_include_path()); + require_once "autoload.php"; require_once "functions.php"; require_once "sessions.php"; require_once "sanity_check.php"; @@ -9,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_connection($link)) return; + if (!init_plugins()) return; $op = $_REQUEST['op']; if ($op == "publish"){ - $key = db_escape_string($link, $_REQUEST["key"]); + $key = $_REQUEST["key"]; + $pdo = Db::pdo(); - $result = db_query($link, "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($link, $_REQUEST); + $opml = new Opml($_REQUEST); $opml->opml_export("", $owner_uid, true, false); } else { @@ -33,6 +34,4 @@ } } - db_close($link); - ?>