summaryrefslogtreecommitdiff
path: root/classes/labels.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-04-04 14:34:08 +0300
committerAndrew Dolgov <[email protected]>2020-04-04 14:34:08 +0300
commit44b1f0fcc0a0497b8fa0895b8655f4f1b9396ace (patch)
tree92949b86c2c67178957d8eac0bcdd14b29723e09 /classes/labels.php
parent586ed55178591948734d54eae293d7d612552b0f (diff)
search: add support for label:XXX search keyword
Labels: enforce case-insensitive lookups when creating/looking for labels
Diffstat (limited to 'classes/labels.php')
-rw-r--r--classes/labels.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/classes/labels.php b/classes/labels.php
index 19d060617..7a69a5191 100644
--- a/classes/labels.php
+++ b/classes/labels.php
@@ -12,7 +12,7 @@ class Labels
static function find_id($label, $owner_uid) {
$pdo = Db::pdo();
- $sth = $pdo->prepare("SELECT id FROM ttrss_labels2 WHERE caption = ?
+ $sth = $pdo->prepare("SELECT id FROM ttrss_labels2 WHERE LOWER(caption) = LOWER(?)
AND owner_uid = ? LIMIT 1");
$sth->execute([$label, $owner_uid]);
@@ -186,7 +186,7 @@ class Labels
}
$sth = $pdo->prepare("SELECT id FROM ttrss_labels2
- WHERE caption = ? AND owner_uid = ?");
+ WHERE LOWER(caption) = LOWER(?) AND owner_uid = ?");
$sth->execute([$caption, $owner_uid]);
if (!$sth->fetch()) {
@@ -202,4 +202,4 @@ class Labels
return $result;
}
-} \ No newline at end of file
+}