Accept server domains with port

This commit is contained in:
Marcel Hellkamp 2023-07-31 17:04:34 +02:00
parent a266b3cbda
commit 4294f3a9a7
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ const config = computed({
const formServers = computed({
get: () => config.value.servers.join(" "),
set: (value) => config.value.servers = (value || "").split(" ").filter(isServer),
set: (value) => config.value.servers = (value || "").replace(/https?:\/\//ig, "").split(/[, ]+/).filter(isServer),
});
const tagPattern = /#?([\p{Letter}\p{Number}\p{Mark}\p{Connector_Punctuation}_]+)/igu

View File

@ -210,7 +210,7 @@ export function isAccount(acc: string) {
}
export function isServer(server: string) {
return isString(server) && server.match(/^([a-z0-9.-]+\.[a-z]{2,})$/i)
return isString(server) && server.match(/^([a-z0-9.-]+\.[a-z]{2,})(:[0-9]{1,5})?$/i)
}
export function isLanguage(lang: string) {