fix fail in sql query of isDuplicate method of OC_Calendar_Import

remotes/origin/stable45
Georg Ehrke 12 years ago
parent 44272b9889
commit 41639f0517
  1. 6
      apps/calendar/lib/import.php

@ -273,8 +273,10 @@ class OC_Calendar_Import{
*/ */
private function isDuplicate($insertid){ private function isDuplicate($insertid){
$newobject = OC_Calendar_Object::find($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=?'); $stmt = OCP\DB::prepare('SELECT COUNT(*) as count FROM *PREFIX*calendar_objects
$result = $stmt->execute(array($newobject['objecttype'],$newobject['startdate'],$newobject['enddate'],$newobject['repeating'],$newobject['summary'],$newobject['calendardata'])); 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(); $result = $result->fetchRow();
if($result['count'] >= 2){ if($result['count'] >= 2){
return true; return true;

Loading…
Cancel
Save