{"record":{"id":"1898e309e9883ee0","repo":"phacility/phabricator","slug":"the-provided-image-uri-must-use-one-of-these-proto","errorCode":null,"errorMessage":"The provided image URI must use one of these protocols: %s.","messagePattern":"The provided image URI must use one of these protocols: (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/controller/PhabricatorFileImageProxyController.php","lineNumber":24,"sourceCode":"  public function shouldAllowPublic() {\n    return true;\n  }\n\n  public function handleRequest(AphrontRequest $request) {\n    $viewer = $request->getViewer();\n    $img_uri = $request->getStr('uri');\n\n    // Validate the URI before doing anything\n    PhabricatorEnv::requireValidRemoteURIForLink($img_uri);\n    $uri = new PhutilURI($img_uri);\n    $proto = $uri->getProtocol();\n\n    $allowed_protocols = array(\n      'http',\n      'https',\n    );\n    if (!in_array($proto, $allowed_protocols)) {\n      throw new Exception(\n        pht(\n          'The provided image URI must use one of these protocols: %s.',\n          implode(', ', $allowed_protocols)));\n    }\n\n    // Check if we already have the specified image URI downloaded\n    $cached_request = id(new PhabricatorFileExternalRequest())->loadOneWhere(\n      'uriIndex = %s',\n      PhabricatorHash::digestForIndex($img_uri));\n\n    if ($cached_request) {\n      return $this->getExternalResponse($cached_request);\n    }\n\n    $ttl = PhabricatorTime::getNow() + phutil_units('7 days in seconds');\n    $external_request = id(new PhabricatorFileExternalRequest())\n      ->setURI($img_uri)\n      ->setTTL($ttl);","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/controller/PhabricatorFileImageProxyController.php#L6-L42","documentation":"Error \"The provided image URI must use one of these protocols: %s.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/files/controller/PhabricatorFileImageProxyController.php:24 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":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}