[Bedework-commit] webapps r1277 - trunk/webcommon/src/org/bedework/webcommon/event

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


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

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

On conversion to icalendar ignore bad uris

Modified: trunk/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java
===================================================================
--- trunk/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java	2011-03-10 19:59:31 UTC (rev 1276)
+++ trunk/webcommon/src/org/bedework/webcommon/event/UpdateEventAction.java	2011-03-10 19:59:36 UTC (rev 1277)
@@ -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
@@ -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