Skip to content

Commit

Permalink
validate.js: make validate_isName() match PHP code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Traumflug committed Apr 21, 2019
1 parent 7ad147d commit f04f1de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion classes/Validate.php
Expand Up @@ -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
*
Expand Down
4 changes: 2 additions & 2 deletions js/validate.js
Expand Up @@ -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)
Expand Down

0 comments on commit f04f1de

Please sign in to comment.