{"record":{"id":"37c01b31b386fe9a","repo":"getgrav/grav","slug":"only-official-gpm-urls-are-allowed-you-can-modify","errorCode":null,"errorMessage":"Only official GPM URLs are allowed. You can modify this behavior in the System configuration.","messagePattern":"Only official GPM URLs are allowed\\. You can modify this behavior in the System configuration\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/GPM/GPM.php","lineNumber":726,"sourceCode":"\n    /**\n     * Download the zip package via the URL\n     *\n     * @param string $package_file\n     * @param string $tmp\n     * @return string|null\n     */\n    public static function downloadPackage($package_file, $tmp)\n    {\n        $package = parse_url($package_file);\n        if (!is_array($package)) {\n            throw new \\RuntimeException(\"Malformed GPM URL: {$package_file}\");\n        }\n\n        $filename = Utils::basename($package['path'] ?? '');\n\n        if (Grav::instance()['config']->get('system.gpm.official_gpm_only') && ($package['host'] ?? null) !== 'getgrav.org') {\n            throw new RuntimeException('Only official GPM URLs are allowed. You can modify this behavior in the System configuration.');\n        }\n\n        $output = Response::get($package_file, []);\n\n        if ($output) {\n            Folder::create($tmp);\n            file_put_contents($tmp . DS . $filename, $output);\n            return $tmp . DS . $filename;\n        }\n\n        return null;\n    }\n\n    /**\n     * Copy the local zip package to tmp\n     *\n     * @param string $package_file\n     * @param string $tmp","sourceCodeStart":708,"sourceCodeEnd":744,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/GPM/GPM.php#L708-L744","documentation":"Error \"Only official GPM URLs are allowed. You can modify this behavior in the System configuration.\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/GPM/GPM.php:726 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"}