{"record":{"id":"a0264e4674b5aad2","repo":"octobercms/october","slug":"please-specify-a-valid-hostname","errorCode":null,"errorMessage":"Please specify a valid hostname","messagePattern":"Please specify a valid hostname","errorType":"validation","errorClass":"October\\Rain\\Exception\\ValidationException","httpStatus":null,"severity":"error","filePath":"modules/system/models/SiteDefinition.php","lineNumber":137,"sourceCode":"        $site->syncOriginal();\n        return $site;\n    }\n\n    /**\n     * beforeValidate\n     */\n    public function beforeValidate()\n    {\n        if ($this->is_custom_url && !Url::isValidUrl($this->app_url)) {\n            throw new ValidationException(['app_url' => __(\"Please specify a valid URL\")]);\n        }\n\n        if ($this->is_prefixed && (substr($this->route_prefix, 0, 1) !== '/' || $this->route_prefix === '/')) {\n            throw new ValidationException(['route_prefix' => __(\"Route prefix must start with a forward slash (/)\")]);\n        }\n\n        if ($this->is_host_restricted && !$this->isAllowHostsValid()) {\n            throw new ValidationException(['allow_hosts' => __(\"Please specify a valid hostname\")]);\n        }\n\n        $this->fallback_locale = $this->getFallbackLocale($this->locale);\n    }\n\n    /**\n     * getFallbackLocale attempts to extract the fallback language from the locale.\n     * @return string\n     */\n    protected function getFallbackLocale($locale)\n    {\n        if ($position = strpos($locale, '-')) {\n            $target = substr($locale, 0, $position);\n            $available = $this->getLocaleOptions();\n            if (isset($available[$target])) {\n                return $target;\n            }\n        }","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/models/SiteDefinition.php#L119-L155","documentation":"Error \"Please specify a valid hostname\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/system/models/SiteDefinition.php:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}