Merge pull request #2252 from nextcloud/enh/noid/domain-dot

domain must contain at least one dot
This commit is contained in:
Simon L 2023-04-01 14:14:32 +02:00 committed by GitHub
commit 565a84a7bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -234,6 +234,11 @@ class ConfigurationManager
* @throws InvalidSettingConfigurationException
*/
public function SetDomain(string $domain) : void {
// Validate that at least one dot is contained
if (strpos($domain, '.') === false) {
throw new InvalidSettingConfigurationException("Domain must contain at least one dot!");
}
// Validate domain
if (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
throw new InvalidSettingConfigurationException("Domain is not a valid domain!");