Skip to content
Snippets Groups Projects

Issue #3356402 by Robert Ngo: URL validation to accept and urlscheme

2 files
+ 21
0
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -19,6 +19,12 @@
// Add messages with translations from backend.
$.extend($.validator.messages, drupalSettings.clientside_validation_jquery.messages);
// Overwrite default URL validation method, accepting public/private urlscheme.
var _urlValidation = $.validator.methods.url;
$.validator.methods.url = function(value, element) {
return _urlValidation.call(this, value, element) || /^(public|private):\/\//.test(value);
}
/**
* Attaches jQuery validate behavior to forms.
*
Loading