mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
make lookup for hostnames case insensitive
This commit is contained in:
parent
684aa97b98
commit
6d21c4bf0d
1 changed files with 3 additions and 3 deletions
|
@ -43,10 +43,10 @@ bool AddressManager::lookupHandledAsNetworkAddress(const QString& lookupString)
|
|||
const QString IP_ADDRESS_REGEX_STRING = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}"
|
||||
"([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:\\d{1,5})?$";
|
||||
|
||||
const QString HOSTNAME_REGEX_STRING = "^(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])"
|
||||
"(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9]))+(:{1}\\d{1,5})?$";
|
||||
const QString HOSTNAME_REGEX_STRING = "^((?:[A-Z0-9]|[A-Z0-9][A-Z0-9\\-]{0,61}[A-Z0-9])"
|
||||
"(?:\\.(?:[A-Z0-9]|[A-Z0-9][A-Z0-9\\-]{0,61}[A-Z0-9]))+|localhost)(:{1}\\d{1,5})?$";
|
||||
|
||||
QRegExp hostnameRegex(HOSTNAME_REGEX_STRING);
|
||||
QRegExp hostnameRegex(HOSTNAME_REGEX_STRING, Qt::CaseInsensitive);
|
||||
|
||||
if (hostnameRegex.indexIn(lookupString) != -1) {
|
||||
emit domainChangeRequired(hostnameRegex.cap(0));
|
||||
|
|
Loading…
Reference in a new issue