summaryrefslogtreecommitdiff
path: root/classes/pref/labels.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-02 08:08:48 +0300
committerAndrew Dolgov <[email protected]>2021-03-02 08:08:48 +0300
commitf56a4eab1711206fd020e5a7a78b2fd1aeae5315 (patch)
tree1e2dd73f053d98dd4ebe8826942e24f39b34e80f /classes/pref/labels.php
parent372e8e062c251f00ee4c2ed9653575c4221bac03 (diff)
use orm for app password stuff
Diffstat (limited to 'classes/pref/labels.php')
-rw-r--r--classes/pref/labels.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/classes/pref/labels.php b/classes/pref/labels.php
index 5bc094d55..2cdb919ce 100644
--- a/classes/pref/labels.php
+++ b/classes/pref/labels.php
@@ -8,14 +8,12 @@ class Pref_Labels extends Handler_Protected {
}
function edit() {
- $label_id = clean($_REQUEST['id']);
+ $label = ORM::for_table('ttrss_labels2')
+ ->where('owner_uid', $_SESSION['uid'])
+ ->find_one($_REQUEST['id']);
- $sth = $this->pdo->prepare("SELECT id, caption, fg_color, bg_color FROM ttrss_labels2 WHERE
- id = ? AND owner_uid = ?");
- $sth->execute([$label_id, $_SESSION['uid']]);
-
- if ($line = $sth->fetch(PDO::FETCH_ASSOC)) {
- print json_encode($line);
+ if ($label) {
+ print json_encode($label->as_array());
}
}