changeset 667:88d0e2ba73ca

quotedb: Use LIKE instead of = for user.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 23 Feb 2021 13:04:24 +0200
parents 79b5d8944eea
children a026f5eb9439
files quotedb.tcl
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/quotedb.tcl	Sat Feb 20 17:52:49 2021 +0200
+++ b/quotedb.tcl	Tue Feb 23 13:04:24 2021 +0200
@@ -147,7 +147,7 @@
   set qoverride [matchattr $uhand n]
   set usql "SELECT utime AS utime FROM $utable WHERE id=$unum"
   if {$qoverride == 0} {
-    append usql " AND user='[utl_escape $uhand]'"
+    append usql " AND user LIKE '[utl_escape $uhand]'"
     set qextra ""
   } else {
     set qextra [qdb_qm $utable "update_override"]
@@ -196,7 +196,7 @@
   set qoverride [matchattr $uhand n]
   set usql "SELECT utime AS utime FROM $utable WHERE id=$unum"
   if {$qoverride == 0} {
-    append usql " AND user='[utl_escape $uhand]'"
+    append usql " AND user LIKE '[utl_escape $uhand]'"
     set qextra ""
   } else {
     set qextra [qdb_qm $utable "update_override"]
@@ -277,7 +277,7 @@
   }
 
   # Check if user has previously voted this item
-  set usql "SELECT id AS qid FROM ${utable}_votes WHERE user='[utl_escape $uhand]' AND urlid=$uid"
+  set usql "SELECT id AS qid FROM ${utable}_votes WHERE user LIKE '[utl_escape $uhand]' AND urlid=$uid"
   qdb_handle eval $usql {
     # Yes, update the previous vote
     set usql "UPDATE ${utable}_votes SET vote=$uvote WHERE id=$qid"