diff --git a/modules/system/system.js b/modules/system/system.js index f4bdc6d07484..910fb5d3d5e0 100644 --- a/modules/system/system.js +++ b/modules/system/system.js @@ -105,7 +105,7 @@ Drupal.behaviors.dateTime = { // Attach keyup handler to custom format inputs. $('input' + source, context).once('date-time').keyup(function () { var input = $(this); - var url = fieldSettings.lookup + (fieldSettings.lookup.match(/\?q=/) ? '&format=' : '?format=') + encodeURIComponent(input.val()); + var url = fieldSettings.lookup + (/\?q=/.test(fieldSettings.lookup) ? '&format=' : '?format=') + encodeURIComponent(input.val()); $.getJSON(url, function (data) { $(suffix).empty().append(' ' + fieldSettings.text + ': ' + data + ''); }); diff --git a/modules/user/user.js b/modules/user/user.js index 042668d81598..d182066ad826 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -95,10 +95,10 @@ Drupal.behaviors.password = { Drupal.evaluatePasswordStrength = function (password, translate) { var weaknesses = 0, strength = 100, msg = []; - var hasLowercase = password.match(/[a-z]+/); - var hasUppercase = password.match(/[A-Z]+/); - var hasNumbers = password.match(/[0-9]+/); - var hasPunctuation = password.match(/[^a-zA-Z0-9]+/); + var hasLowercase = /[a-z]+/.test(password); + var hasUppercase = /[A-Z]+/.test(password); + var hasNumbers = /[0-9]+/.test(password); + var hasPunctuation = /[^a-zA-Z0-9]+/.test(password); // If there is a username edit box on the page, compare password to that, otherwise // use value from the database.