disallow creating timka.su and not-url links
parent
2eb7bcd95f
commit
3d637372ca
|
@ -19,7 +19,8 @@ class AddLink extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
short () {
|
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
|
return
|
||||||
}
|
}
|
||||||
var linkName = makeid(6)
|
var linkName = makeid(6)
|
||||||
|
|
Loading…
Reference in New Issue