summaryrefslogtreecommitdiff
path: root/opml.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-12-02 11:42:42 +0300
committerAndrew Dolgov <[email protected]>2017-12-02 11:42:42 +0300
commita77a47332cd70059486e5888bc5987ce516dcf5b (patch)
treedbd5e46b82cedb21887935f7b09d83c2ae99a8fa /opml.php
parentf8108cc28df586f9fecad4e48052a1cb82891e4a (diff)
opml host, update: use PDO
Diffstat (limited to 'opml.php')
-rw-r--r--opml.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/opml.php b/opml.php
index af3694051..bdee88e08 100644
--- a/opml.php
+++ b/opml.php
@@ -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);