mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-12-31 02:52:19 +08:00
domain must contain at least one dot
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
7ccc699402
commit
cc13161ec6
1 changed files with 5 additions and 0 deletions
|
@ -234,6 +234,11 @@ class ConfigurationManager
|
||||||
* @throws InvalidSettingConfigurationException
|
* @throws InvalidSettingConfigurationException
|
||||||
*/
|
*/
|
||||||
public function SetDomain(string $domain) : void {
|
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
|
// Validate domain
|
||||||
if (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
|
if (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
|
||||||
throw new InvalidSettingConfigurationException("Domain is not a valid domain!");
|
throw new InvalidSettingConfigurationException("Domain is not a valid domain!");
|
||||||
|
|
Loading…
Reference in a new issue