{"record":{"id":"7d5c3d52d4a0de2a","repo":"getgrav/grav","slug":"the-path-of-a-uri-with-an-authority-must-start-wit","errorCode":null,"errorMessage":"The path of a URI with an authority must start with a slash '/' or be empty","messagePattern":"The path of a URI with an authority must start with a slash '/' or be empty","errorType":"validation","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Framework/Psr7/AbstractUri.php","lineNumber":415,"sourceCode":"            );\n        }\n\n        if ($this->getAuthority() === \"\") {\n            if (str_starts_with($this->path, \"//\")) {\n                throw new InvalidArgumentException(\n                    'The path of a URI without an authority must not start with two slashes \\'//\\''\n                );\n            }\n            if (\n                $this->scheme === \"\" &&\n                str_contains(explode(\"/\", $this->path, 2)[0], \":\")\n            ) {\n                throw new InvalidArgumentException(\n                    \"A relative URI must not have a path beginning with a segment containing a colon\"\n                );\n            }\n        } elseif (isset($this->path[0]) && $this->path[0] !== \"/\") {\n            throw new InvalidArgumentException(\n                'The path of a URI with an authority must start with a slash \\'/\\' or be empty'\n            );\n        }\n    }\n\n    /**\n     * @return bool\n     */\n    protected function isDefaultPort()\n    {\n        $scheme = $this->scheme;\n        $port = $this->port;\n\n        return $this->port === null ||\n            (isset(static::$defaultPorts[$scheme]) &&\n                $port === static::$defaultPorts[$scheme]);\n    }\n","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Framework/Psr7/AbstractUri.php#L397-L433","documentation":"Error \"The path of a URI with an authority must start with a slash '/' or be empty\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Framework/Psr7/AbstractUri.php:415 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"}