Skip to content
Snippets Groups Projects
Commit ccdb2195 authored by Robin Appelman's avatar Robin Appelman
Browse files

use = instead of LIKE when selecting private attributes

parent 3b065d4d
No related branches found
No related tags found
No related merge requests found
......@@ -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)."'");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment