Skip to content

Commit 70bcef9

Browse files
author
XuChenhui
committed
Fix extend bug may be pollute global variable $.formUtils.LANG
1 parent c0a812e commit 70bcef9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

form-validator/jquery.form-validator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
if(!eventContext)
146146
eventContext = 'blur';
147147

148-
language = $.extend($.formUtils.LANG, language || {});
148+
language = $.extend({}, $.formUtils.LANG, language || {});
149149
_removeErrorStyle(this, conf);
150150

151151
var $elem = this,
@@ -209,7 +209,7 @@
209209
*/
210210
$.fn.validateForm = function(language, conf) {
211211

212-
language = $.extend($.formUtils.LANG, language || {});
212+
language = $.extend({}, $.formUtils.LANG, language || {});
213213

214214
$.formUtils.isValidatingEntireForm = true;
215215
$.formUtils.haltValidation = false;

0 commit comments

Comments
 (0)