← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8640: Fixed vulnerability in validation js

 

------------------------------------------------------------
revno: 8640
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-10-22 13:05:48 +0200
message:
  Fixed vulnerability in validation js
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-10-21 12:56:21 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-10-22 11:05:48 +0000
@@ -1178,7 +1178,13 @@
  */
 function validation2( formId, submitHandler, kwargs )
 {
-	var beforeValidateHandler = kwargs["beforeValidateHandler"];
+	var beforeValidateHandler = null;
+	
+	if ( isDefined( kwargs ) )
+	{
+		beforeValidateHandler = kwargs["beforeValidateHandler"];
+	}
+
 	var rules = kwargs["rules"];
 	var validator = jQuery( "#" + formId ).validate( {
 		meta: "validate",

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2012-10-21 12:56:21 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2012-10-22 11:05:48 +0000
@@ -95,11 +95,6 @@
 	{
 		$.validator.setMessages( validationMessage );
 	}
-	
-	$.validator.setDefaults( {
-		debug: false,
-		success: "valid"
-	} );
 }
 
 function setTableStyles()