{"action":"closed","issue":{"url":"https://api.github.com/repos/EddyVerbruggen/Calendar-PhoneGap-Plugin/issues/131","labels_url":"https://api.github.com/repos/EddyVerbruggen/Calendar-PhoneGap-Plugin/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/EddyVerbruggen/Calendar-PhoneGap-Plugin/issues/131/comments","events_url":"https://api.github.com/repos/EddyVerbruggen/Calendar-PhoneGap-Plugin/issues/131/events","html_url":"https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/issues/131","id":56809802,"number":131,"title":"ios app crashes while finding an event with location containing single quotes ","user":{"login":"sreejith-m-sreedharan1987","id":8026983,"avatar_url":"https://avatars.githubusercontent.com/u/8026983?v=3","gravatar_id":"","url":"https://api.github.com/users/sreejith-m-sreedharan1987","html_url":"https://github.com/sreejith-m-sreedharan1987","followers_url":"https://api.github.com/users/sreejith-m-sreedharan1987/followers","following_url":"https://api.github.com/users/sreejith-m-sreedharan1987/following{/other_user}","gists_url":"https://api.github.com/users/sreejith-m-sreedharan1987/gists{/gist_id}","starred_url":"https://api.github.com/users/sreejith-m-sreedharan1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreejith-m-sreedharan1987/subscriptions","organizations_url":"https://api.github.com/users/sreejith-m-sreedharan1987/orgs","repos_url":"https://api.github.com/users/sreejith-m-sreedharan1987/repos","events_url":"https://api.github.com/users/sreejith-m-sreedharan1987/events{/privacy}","received_events_url":"https://api.github.com/users/sreejith-m-sreedharan1987/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-06T13:09:46Z","updated_at":"2015-03-14T19:36:01Z","closed_at":"2015-03-14T19:36:01Z","body":"This issue occurs in all versions of ios devices.  Create an event in calendar with location or title containing a single quote, the createEventInNamedCalendar() succeeds and creates an event in calendar with that single quote.\r\n\r\nBut, the problem occurs when finding that event using findAllEventsInNamedCalendar().\r\n\r\nThe app crashes immediately upon finding such entries. \r\nI went through the code and i could see that line number 214 to 231 in Calendar.m causes this issue.\r\nYou have written In line number 218,\r\n\r\n [predicateStrings addObject:[NSString stringWithFormat:@\"location == '%@'\", location]];\r\n\r\nand then in line number 229,\r\n\r\n if (predicateString.length > 0) {\r\n    matches = [NSPredicate predicateWithFormat:predicateString];\r\n\r\nthe 'matches' resolves to nil when a location name with a single quote is passed. And the app quits suddenly throwing an error.\r\n\r\nThis is because the quotes are not properly escaped in the predicate string.\r\n\r\nPlease fix this issue at the earliest since it will cause the sudden death of the app on executing the above code.\r\n\r\nThanks for creating and maintaining this useful repository."}}