disallow creating timka.su and not-url links

This commit is contained in:
timka123 committed 2023-11-23 18:54:03 +03:00
1 parent 2eb7bcd95f
commit 3d637372ca
1 file changed
+2 -1
+2 -1
View File
@@ -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)