[Bedework-commit] webapps r1276 - releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event

svnadmin at bedework.org svnadmin at bedework.org
Thu Mar 10 14:59:32 EST 2011


Author: douglm
Date: 2011-03-10 14:59:31 -0500 (Thu, 10 Mar 2011)
New Revision: 1276

Modified:
   releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java
Log:
Validate the URI property on input.

On conversion to icalendar ignore bad uris

Modified: releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java
===================================================================
--- releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java	2011-03-05 19:07:21 UTC (rev 1275)
+++ releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java	2011-03-10 19:59:31 UTC (rev 1276)
@@ -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
@@ -18,6 +18,18 @@
 */
 package org.bedework.webcommon.event;
 
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import net.fortuna.ical4j.model.Dur;
+import net.fortuna.ical4j.model.Recur;
+
 import org.bedework.appcommon.AccessXmlUtil;
 import org.bedework.appcommon.ClientError;
 import org.bedework.appcommon.ClientMessage;
@@ -52,18 +64,6 @@
 import edu.rpi.sss.util.DateTimeUtil;
 import edu.rpi.sss.util.Util;
 
-import net.fortuna.ical4j.model.Dur;
-import net.fortuna.ical4j.model.Recur;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
 /** Action to add or modify an Event. The form has an addingEvent property to
  * distinguish.
  *
@@ -395,6 +395,12 @@
     /* ------------------------- Link ---------------------------- */
 
     String link = Util.checkNull(form.getEventLink());
+    if (Util.validURI(link) == null) {
+      form.getErr().emit(ValidationError.invalidUri);
+      svci.rollbackTransaction();
+      return forwardValidationError;
+    }
+
     if (!Util.equalsString(ev.getLink(), link)) {
       ev.setLink(link);
       changes.changed(PropertyInfoIndex.URL);



More information about the Bedework-commit mailing list