mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-29 14:10:41 +03:00
regex for avatars
This commit is contained in:
parent
39bb72d73b
commit
1f737277b2
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ app.post("/", rateLimit({
|
|||
|
||||
|
||||
const user2 = new UserModel({ name: req.body.username })
|
||||
if (avatar) user2.avatar = avatar;
|
||||
if (avatar&&/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g.test(avatar)) user2.avatar = avatar;
|
||||
await user2.takeId()
|
||||
await user2.save();
|
||||
|
||||
|
|
Loading…
Reference in a new issue