[Bedework-commit] calendarapi r1466 - in trunk:
calFacade/src/org/bedework/calfacade/exc
icalendar/src/org/bedework/icalendar
svnadmin at bedework.org
svnadmin at bedework.org
Thu Mar 10 14:59:42 EST 2011
Author: douglm
Date: 2011-03-10 14:59:41 -0500 (Thu, 10 Mar 2011)
New Revision: 1466
Modified:
trunk/calFacade/src/org/bedework/calfacade/exc/ValidationError.java
trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java
Log:
Validate the URI property on input.
On conversion to icalendar ignore bad uris
Modified: trunk/calFacade/src/org/bedework/calfacade/exc/ValidationError.java
===================================================================
--- trunk/calFacade/src/org/bedework/calfacade/exc/ValidationError.java 2011-03-10 19:59:35 UTC (rev 1465)
+++ trunk/calFacade/src/org/bedework/calfacade/exc/ValidationError.java 2011-03-10 19:59:41 UTC (rev 1466)
@@ -6,9 +6,9 @@
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at:
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -128,6 +128,9 @@
/** Error: Invalid transparency. */
public static final String invalidTransparency = prefix + "invalid.transparency";
+ /** Error: Invalid URI. */
+ public static final String invalidUri = prefix + "invalid.uri";
+
/** Error: Invalid user. */
public static final String invalidUser = prefix + "invalid.user";
Modified: trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java
===================================================================
--- trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java 2011-03-10 19:59:35 UTC (rev 1465)
+++ trunk/icalendar/src/org/bedework/icalendar/VEventUtil.java 2011-03-10 19:59:41 UTC (rev 1466)
@@ -6,9 +6,9 @@
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at:
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -35,6 +35,7 @@
import org.bedework.calfacade.exc.CalFacadeException;
import edu.rpi.cmt.calendar.IcalDefs;
+import edu.rpi.sss.util.Util;
import net.fortuna.ical4j.model.CategoryList;
import net.fortuna.ical4j.model.Date;
@@ -469,7 +470,10 @@
}
if ((strval != null) && (strval.length() > 0)) {
- pl.add(new Url(new URI(strval)));
+ URI uri = Util.validURI(strval);
+ if (uri != null) {
+ pl.add(new Url(uri));
+ }
}
/* ------------------- X-PROPS -------------------- */
More information about the Bedework-commit
mailing list