Skip to content

Commit edaeb17

Browse files
committed
Manually added the fix from pr victorjonsson#187
1 parent 4ce6186 commit edaeb17

File tree

9 files changed

+30
-28
lines changed

9 files changed

+30
-28
lines changed

form-validator/date.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.19
13+
* @version 2.2.beta.21
1414
*/
1515
(function($) {
1616

form-validator/file.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.19
13+
* @version 2.2.beta.21
1414
*/
1515
(function($, window) {
1616

form-validator/html5.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @website http://formvalidator.net/
1919
* @license Dual licensed under the MIT or GPL Version 2 licenses
20-
* @version 2.2.beta.19
20+
* @version 2.2.beta.21
2121
*/
2222
(function($, window) {
2323

form-validator/jquery.form-validator.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @website http://formvalidator.net/
77
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 2.2.beta.19
8+
* @version 2.2.beta.21
99
*/
1010
(function($) {
1111

@@ -487,32 +487,34 @@
487487

488488
/**
489489
* A bit smarter split function
490+
* delimiter can be space comma dash or pipe
490491
* @param {String} val
491492
* @param {Function|String} [func]
492-
* @param {String} [delim]
493493
* @returns {Array|void}
494494
*/
495-
$.split = function(val, func, delim) {
495+
$.split = function(val, func) {
496496
if( typeof func != 'function' ) {
497-
// return string
497+
// return array
498498
if( !val )
499499
return [];
500500
var values = [];
501-
$.each(val.split(func ? func:','), function(i,str) {
502-
str = $.trim(str);
503-
if( str.length )
504-
values.push(str);
505-
});
501+
$.each(val.split(func ? func: /[,|-\s]\s*/g ),
502+
function(i,str) {
503+
str = $.trim(str);
504+
if( str.length )
505+
values.push(str);
506+
}
507+
);
506508
return values;
507509
} else if( val ) {
508-
// use callback on each
509-
if( !delim )
510-
delim = ',';
511-
$.each(val.split(delim), function(i, str) {
512-
str = $.trim(str);
513-
if( str.length )
514-
return func(str, i);
515-
});
510+
// exec callback func on each
511+
$.each(val.split(/[,|-\s]\s*/g),
512+
function(i, str) {
513+
str = $.trim(str);
514+
if( str.length )
515+
return func(str, i);
516+
}
517+
);
516518
}
517519
};
518520

@@ -1042,7 +1044,7 @@
10421044
numericRangeCheck : function(value, rangeAllowed)
10431045
{
10441046
// split by dash
1045-
var range = $.split(rangeAllowed, '-');
1047+
var range = $.split(rangeAllowed);
10461048
// min or max
10471049
var minmax = parseInt(rangeAllowed.substr(3),10)
10481050
// range ?

form-validator/jquery.form-validator.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.19
13+
* @version 2.2.beta.21
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* - cvv
1414
*
1515
* @website http://formvalidator.net/#security-validators
16-
* @version 2.2.beta.19
16+
* @version 2.2.beta.21
1717
*/
1818
(function($, window) {
1919

form-validator/sweden.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @website http://formvalidator.net/#swedish-validators
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 2.2.beta.19
16+
* @version 2.2.beta.21
1717
*/
1818
(function($, window) {
1919

form-validator/uk.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @website http://formvalidator.net/#uk-validators
1111
* @license Dual licensed under the MIT or GPL Version 2 licenses
12-
* @version 2.2.beta.19
12+
* @version 2.2.beta.21
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)