Skip to content

Commit cb9b94f

Browse files
committed
fixed float parameter validation
1 parent a5b3fb7 commit cb9b94f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/weh-prefs.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Prefs.prototype ={
219219
/* falls through */
220220
case"float":
221221
if(spec.type=="float"){
222-
if(!/^-?[0-9]+(\.[0-9]+)$/.test(value))
222+
if(!/^-?[0-9]+(\.[0-9]+)?|(\.[0-9]+)$/.test(value))
223223
returnfalse;
224224
if(isNaN(parseFloat(value)))
225225
returnfalse;

0 commit comments

Comments
(0)