HEX
Server:Apache
System:Linux localhost 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64
User:enlugo-es (10006)
PHP:7.4.33
Disabled:opcache_get_status
Upload Files
File: /var/www/vhosts/enlugo.es/httpdocs/wp-content/plugins/w3-total-cache/pub/js/options-validator.js
jQuery(document).ready(function() {
	jQuery('textarea[w3tc-data-validator="regexps"]').change(function() {
		var v = jQuery(this).val();
		var items = v.split("\n");

		for (var n = 0; n < items.length; n++) {
			var regexp = items[n].trim();
			if (regexp.length > 0) {
				try {
					new RegExp(regexp);
				} catch(e) {
					var error = 'Contains invalid regexp ' + regexp +', please fix';
					console.log(error);
					jQuery(this)[0].setCustomValidity(error);
					return;
				}
			}
		}

		jQuery(this)[0].setCustomValidity('');
	});
});