mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Made calendar event parsing more robust, and also reject non-calendar contents a little faster.
git-svn-id: https://zxing.googlecode.com/svn/trunk@604 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
13c08aedaf
commit
45677f2bb2
|
@ -35,11 +35,13 @@ final class VEventResultParser extends ResultParser {
|
|||
return null;
|
||||
}
|
||||
int vEventStart = rawText.indexOf("BEGIN:VEVENT");
|
||||
int vEventEnd = rawText.indexOf("END:VEVENT");
|
||||
if (vEventStart < 0 || vEventEnd < 0) {
|
||||
if (vEventStart < 0) {
|
||||
return null;
|
||||
}
|
||||
int vEventEnd = rawText.indexOf("END:VEVENT");
|
||||
if (vEventEnd < 0) {
|
||||
return null;
|
||||
}
|
||||
rawText = rawText.substring(vEventStart + 14, vEventEnd); // skip over BEGIN:VEVENT\r\n at start
|
||||
|
||||
String summary = VCardResultParser.matchSingleVCardPrefixedField("SUMMARY", rawText, true);
|
||||
String start = VCardResultParser.matchSingleVCardPrefixedField("DTSTART", rawText, true);
|
||||
|
|
Loading…
Reference in a new issue