{"record":{"id":"b8629c781c7b2914","repo":"getgrav/grav","slug":"malformed-url-url","errorCode":null,"errorMessage":"Malformed URL: {url}","messagePattern":"Malformed URL: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Uri.php","lineNumber":1350,"sourceCode":"    /**\n     * Does this Uri use a standard port?\n     *\n     * @return bool\n     */\n    protected function hasStandardPort()\n    {\n        return (!$this->port || $this->port === 80 || $this->port === 443);\n    }\n\n    /**\n     * @param string $url\n     */\n    protected function createFromString($url)\n    {\n        // Set Uri parts.\n        $parts = parse_url($url);\n        if ($parts === false) {\n            throw new RuntimeException('Malformed URL: ' . $url);\n        }\n        $port = (int)($parts['port'] ?? 0);\n\n        $this->scheme = $parts['scheme'] ?? null;\n        $this->user = $parts['user'] ?? null;\n        $this->password = $parts['pass'] ?? null;\n        $this->host = $parts['host'] ?? null;\n        $this->port = $port ?: null;\n        $this->path = $parts['path'] ?? '';\n        $this->query = $parts['query'] ?? '';\n        $this->fragment = $parts['fragment'] ?? null;\n\n        // Validate the hostname\n        if ($this->host) {\n            $this->host = $this->validateHostname($this->host) ? $this->host : 'unknown';\n        }\n        // Filter userinfo, path, query string and fragment.\n        $this->user = $this->user !== null ? static::filterUserInfo($this->user) : null;","sourceCodeStart":1332,"sourceCodeEnd":1368,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Uri.php#L1332-L1368","documentation":"Error \"Malformed URL: {url}\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Uri.php:1350 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":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}