Browse Source

- fixed security issue with mtwin.web.Request getInt() and getFloat() which returned null when encountering 'NULL' string even when an optional value was used, this situation now throws a DEPRECATED exception (to detect NULL cases).

Laurent Bedubourg 16 years ago
parent
commit
7be9a9de2f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      std/mtwin/web/Request.hx

+ 2 - 2
std/mtwin/web/Request.hx

@@ -74,7 +74,7 @@ class Request {
 		if( params.exists(key) ){
 		if( params.exists(key) ){
 			var v = params.get(key);
 			var v = params.get(key);
 			if( v == "NULL" )
 			if( v == "NULL" )
-				return null;
+				throw "DEPRECATED";
 			return Std.parseInt(v);
 			return Std.parseInt(v);
 		}
 		}
 		return or;
 		return or;
@@ -84,7 +84,7 @@ class Request {
 		if( params.exists(key) ){
 		if( params.exists(key) ){
 			var v = params.get(key);
 			var v = params.get(key);
 			if( v == "NULL" )
 			if( v == "NULL" )
-				return null;
+				throw "DEPRECATED";
 			return Std.parseFloat(v);
 			return Std.parseFloat(v);
 		}
 		}
 		return or;
 		return or;