Mercurial > hg > egg-tcls
changeset 615:1dac9129eb0f
tj: Change #id handling to be case-insensitive.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Feb 2021 12:34:12 +0200 |
parents | 8c61b4032648 |
children | 20dba2c757de |
files | tj.tcl |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/tj.tcl Wed Feb 10 11:30:11 2021 +0200 +++ b/tj.tcl Wed Feb 10 12:34:12 2021 +0200 @@ -94,7 +94,7 @@ upvar $rid uid if {[string index $rstr 0] == "#"} { - set uid [string tolower [string range $rstr 1 end]] + set uid [string range $rstr 1 end] incr uindex return 1 } else { @@ -170,7 +170,7 @@ proc tj_display_tjs {upublic unick uchan uname uid} { set uclock [clock seconds] set nresults 0 - set usql "SELECT * FROM tj WHERE uuser='[utl_escape $uname]' AND utype=0 AND uid='[utl_escape $uid]'" + set usql "SELECT * FROM tj WHERE uuser='[utl_escape $uname]' AND utype=0 AND uid LIKE '[utl_escape $uid]'" tj_dbh eval $usql { incr nresults set ustamp [utl_sql_datetime_to_stamp $utarget] @@ -288,7 +288,7 @@ # Check if ID exists set umode 1 set nres 0 - set usql "SELECT * FROM tj WHERE uid='[utl_escape $uid]'" + set usql "SELECT * FROM tj WHERE uid LIKE '[utl_escape $uid]'" tj_dbh eval $usql { set umode 0 set cid $id @@ -357,7 +357,7 @@ } if {[llength $usqlargs] > 0} { - set usql "UPDATE tj SET [join $usqlargs ,] WHERE uid='[utl_escape $uid]'" + set usql "UPDATE tj SET [join $usqlargs ,] WHERE uid LIKE '[utl_escape $uid]'" if {[catch {tj_dbh eval $usql} uerrmsg]} { tj_msg $upublic $unick $uchan "err_sql" [list $uerrmsg] tj_log "$uerrmsg on SQL:\n$usql"