]> source.dussan.org Git - nextcloud-server.git/commitdiff
use = instead of LIKE when selecting private attributes
authorRobin Appelman <icewind1991@gmail.com>
Tue, 27 Jul 2010 22:10:30 +0000 (00:10 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Tue, 27 Jul 2010 22:10:30 +0000 (00:10 +0200)
inc/lib_ocs.php

index 055a8587a600596898527fd3c2e3e15c1296f46c..3a675b64d8a0faa487c517189cbcb98b33811138 100644 (file)
@@ -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)."'");