Browse Source

Merge pull request #123 from quank123wip/master

Add username_regex to allow change username restriction
pull/6/head
Menci 6 years ago committed by GitHub
parent
commit
3a0b1aa241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      config-example.json
  2. 2
      utility.js

3
config-example.json

@ -121,5 +121,6 @@
"type": "like-google-fonts",
"url": "https://fonts.loli.net"
},
"no_cdn": false
"no_cdn": false,
"username_regex": "^[a-zA-Z0-9\\-\\_]+$"
}

2
utility.js

@ -255,7 +255,7 @@ module.exports = {
return md5.digest('hex');
},
isValidUsername(s) {
return /^[a-zA-Z0-9\-\_]+$/.test(s);
return RegExp(syzoj.config.username_regex).test(s);
},
locks: [],
lock(key, cb) {

Loading…
Cancel
Save