mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
Merge pull request #331 from nextcloud/enh/310/improve-domain-check
improve domain check
This commit is contained in:
commit
866519be88
1 changed files with 3 additions and 3 deletions
|
|
@ -117,8 +117,8 @@ class ConfigurationManager
|
|||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
public function SetDomain(string $domain) : void {
|
||||
// Validate URL
|
||||
if (!filter_var('http://' . $domain, FILTER_VALIDATE_URL)) {
|
||||
// Validate domain
|
||||
if (!filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)) {
|
||||
throw new InvalidSettingConfigurationException("Domain is not in a valid format!");
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ class ConfigurationManager
|
|||
$response = str_replace("\n", "", $response);
|
||||
|
||||
if($response !== $instanceID) {
|
||||
throw new InvalidSettingConfigurationException("Domain does not point to this server.");
|
||||
throw new InvalidSettingConfigurationException("Domain does not point to this server or reverse proxy not configured correctly.");
|
||||
}
|
||||
|
||||
// Write domain
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue