{"record":{"id":"bfdcca5ebf65ae8f","repo":"nextcloud/all-in-one","slug":"domain-must-not-contain-slashes","errorCode":null,"errorMessage":"Domain must not contain slashes!","messagePattern":"Domain must not contain slashes!","errorType":"validation","errorClass":"InvalidSettingConfigurationException","httpStatus":422,"severity":"error","filePath":"php/src/Data/ConfigurationManager.php","lineNumber":604,"sourceCode":"            return trim((string)file_get_contents($path));\n        }\n        return '';\n    }\n\n    /**\n     * @throws InvalidSettingConfigurationException\n     *\n     * We can't turn this into a private validation method because of the second argument.\n     */\n    public function setDomain(string $domain, bool $skipDomainValidation) : void {\n        // Validate that at least one dot is contained\n        if (!str_contains($domain, '.')) {\n            throw new InvalidSettingConfigurationException(\"Domain must contain at least one dot!\");\n        }\n\n        // Validate that no slashes are contained\n        if (str_contains($domain, '/')) {\n            throw new InvalidSettingConfigurationException(\"Domain must not contain slashes!\");\n        }\n\n        // Validate that no colons are contained\n        if (str_contains($domain, ':')) {\n            throw new InvalidSettingConfigurationException(\"Domain must not contain colons!\");\n        }\n\n        // Validate domain\n        if (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {\n            throw new InvalidSettingConfigurationException(\"Domain is not a valid domain!\");\n        }\n\n        // Validate that it is not an IP-address\n        if(filter_var($domain, FILTER_VALIDATE_IP)) {\n            throw new InvalidSettingConfigurationException(\"Please enter a domain and not an IP-address!\");\n        }\n\n        // Skip domain validation if opted in to do so","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/nextcloud/all-in-one/blob/6b788eec5e61733cf03ed380a3572e43ae3f11ce/php/src/Data/ConfigurationManager.php#L586-L622","documentation":"Second check in ConfigurationManager::setDomain(): the domain string must not contain any '/'. Users hit it by pasting a full URL or a URL-with-path instead of a bare hostname. It throws InvalidSettingConfigurationException → HTTP 422 with this message shown in the AIO interface. The check runs before hostname-format validation and cannot be skipped.","triggerScenarios":"domain='https://cloud.example.com' (scheme pasted); domain='cloud.example.com/' (trailing slash); domain='cloud.example.com/nextcloud' (path appended); browser autofill inserting the full URL into the domain field.","commonSituations":"Copy-pasting from the browser address bar; users assuming the field wants a URL; scripts forwarding a URL variable straight into the domain setting.","solutions":["Enter only the bare hostname: 'cloud.example.com' — no scheme, no path, no trailing slash","If scripting, extract the host first: $host = parse_url($url, PHP_URL_HOST);","Leave out 'https://' — AIO constructs URLs itself in later validation steps"],"exampleFix":"// before\ndomain = 'https://cloud.example.com/nextcloud'\n// after\ndomain = 'cloud.example.com'","handlingStrategy":"validation","validationCode":"// Strip pasted URLs down to the host before submitting\nif (str_contains($domain, '/')) {\n    $domain = parse_url($domain, PHP_URL_HOST) ?? $domain;\n}\nif (str_contains($domain, '/')) {\n    $errors[] = 'Submit a bare hostname without scheme or path';\n}","typeGuard":null,"tryCatchPattern":"use AIO\\Data\\InvalidSettingConfigurationException;\n\ntry {\n    $configurationManager->setDomain($domain, $skipDomainValidation);\n} catch (InvalidSettingConfigurationException $e) {\n    $formErrors[] = $e->getMessage(); // safe to display verbatim\n}","preventionTips":["Normalize input with parse_url(..., PHP_URL_HOST) before storing or posting","Keep the domain field a plain text input without URL autofill","Trim whitespace from pasted values"],"tags":["php","nextcloud-aio","domain-validation","configuration","input-validation"],"backgroundTag":"invalid-domain-format","analyzedSha":"6b788eec5e61733cf03ed380a3572e43ae3f11ce","analyzedAt":"2026-08-21T05:47:24.382Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}