Skip to content
Permalink
Browse files

validate.js: make validate_isName() match PHP code.

  • Loading branch information...
Traumflug committed Apr 21, 2019
1 parent 7ad147d commit f04f1ded917b702465b2da6adfb7d573fdb974ad
Showing with 4 additions and 3 deletions.
  1. +2 −1 classes/Validate.php
  2. +2 −2 js/validate.js
@@ -232,7 +232,8 @@ public static function isImageSize($size)
}
/**
* Check for name validity
* Check for name validity. This should match validate_isName() in
* js/validate.js.
*
* @param string $name Name to validate
*
@@ -106,8 +106,8 @@ var unicode_hack = (function() {
*/
function validate_isName(s)
{
var reg = /^[^0-9!<>,;?=+()@#"°{}_$%:]+$/;
return reg.test(s);
return ! /www|http/i.test(s)
&& /^[^0-9!\[\]<>;?=+()@#"°{}_$%:\/\\\*\^]*$/.test(s);
}

function validate_isGenericName(s)

0 comments on commit f04f1de

Please sign in to comment.
You can’t perform that action at this time.