diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-08-17 21:29:26 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-08-17 21:29:26 +0200 |
commit | 41639f05174ecbf1042ae1ab53ab6374861badce (patch) | |
tree | cc7d4db89ffdfd41b58056bedb21f19111d39d15 | |
parent | 44272b9889149e251da41c6fe7c61a7720d57b71 (diff) | |
download | nextcloud-server-41639f05174ecbf1042ae1ab53ab6374861badce.tar.gz nextcloud-server-41639f05174ecbf1042ae1ab53ab6374861badce.zip |
fix fail in sql query of isDuplicate method of OC_Calendar_Import
-rw-r--r-- | apps/calendar/lib/import.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/calendar/lib/import.php b/apps/calendar/lib/import.php index d36891cb2b9..368f8406e71 100644 --- a/apps/calendar/lib/import.php +++ b/apps/calendar/lib/import.php @@ -273,8 +273,10 @@ class OC_Calendar_Import{ */ private function isDuplicate($insertid){ $newobject = OC_Calendar_Object::find($insertid); - $stmt = OCP\DB::prepare('SELECT COUNT(*) as count FROM *PREFIX*calendar_objects WHERE objecttype=? AND startdate=? AND enddate=? AND repeating=? AND summary=? AND calendardata=?'); - $result = $stmt->execute(array($newobject['objecttype'],$newobject['startdate'],$newobject['enddate'],$newobject['repeating'],$newobject['summary'],$newobject['calendardata'])); + $stmt = OCP\DB::prepare('SELECT COUNT(*) as count FROM *PREFIX*calendar_objects + INNER JOIN *PREFIX*calendar_calendars ON calendarid=*PREFIX*calendar_calendars.id + WHERE objecttype=? AND startdate=? AND enddate=? AND repeating=? AND summary=? AND calendardata=? AND userid = ?'); + $result = $stmt->execute(array($newobject['objecttype'],$newobject['startdate'],$newobject['enddate'],$newobject['repeating'],$newobject['summary'],$newobject['calendardata'], $this->userid)); $result = $result->fetchRow(); if($result['count'] >= 2){ return true; |