From ccdb21958eec6026d87a547a9c87aaf9f55159f4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 28 Jul 2010 00:10:30 +0200 Subject: [PATCH] use = instead of LIKE when selecting private attributes --- inc/lib_ocs.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inc/lib_ocs.php b/inc/lib_ocs.php index 055a8587a60..3a675b64d8a 100644 --- a/inc/lib_ocs.php +++ b/inc/lib_ocs.php @@ -450,7 +450,7 @@ class OC_OCS { if (!trim($key)) { $result = OC_DB::select("select key,value,timestamp from {$CONFIG_DBTABLEPREFIX}privatedata order by timestamp desc"); } else { - $result = OC_DB::select("select key,value,timestamp from {$CONFIG_DBTABLEPREFIX}privatedata where key like'% ".addslashes($key)."%' order by timestamp desc"); + $result = OC_DB::select("select key,value,timestamp from {$CONFIG_DBTABLEPREFIX}privatedata where key ='".addslashes($key)."' order by timestamp desc"); } $itemscount=count($result); @@ -480,7 +480,6 @@ class OC_OCS { $result=OC_DB::select("select count(*) as co from {$CONFIG_DBTABLEPREFIX}privatedata where key = '".addslashes($key)."'"); $totalcount=$result[0]['co']; - OC_DB::free_result($result); if ($totalcount != 0) { $result = OC_DB::query("update {$CONFIG_DBTABLEPREFIX}privatedata set value='".addslashes($value)."', timestamp = datetime('now') where key = '".addslashes($key)."'"); -- 2.39.5