From 3b065d4daec2b0ee6744a66e4eb9739d7d614903 Mon Sep 17 00:00:00 2001
From: "Martin T. H. Sandsmark" <sandsmark@samfundet.no>
Date: Sun, 25 Jul 2010 13:14:26 +0200
Subject: [PATCH] more addslashes magic sauce

---
 inc/lib_ocs.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/inc/lib_ocs.php b/inc/lib_ocs.php
index 16b0832fbe..055a8587a6 100644
--- a/inc/lib_ocs.php
+++ b/inc/lib_ocs.php
@@ -478,7 +478,7 @@ class OC_OCS {
     //TODO: prepared statements, locking tables, fancy stuff, error checking/handling
     $user=OC_OCS::checkpassword();
 
-    $result=OC_DB::select("select count(*) as co from {$CONFIG_DBTABLEPREFIX}privatedata where key = '".$key."'");
+    $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);
 
-- 
GitLab