disallow creating timka.su and not-url links
This commit is contained in:
parent
2eb7bcd95f
commit
3d637372ca
@ -19,7 +19,8 @@ class AddLink extends Component {
|
||||
}
|
||||
|
||||
short () {
|
||||
if (this.state.value === "") {
|
||||
const regex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
|
||||
if (this.state.value === "" || this.state.value.includes('timka.su') || !(regex.test(this.state.value))) {
|
||||
return
|
||||
}
|
||||
var linkName = makeid(6)
|
||||
|
Loading…
Reference in New Issue
Block a user