revisionID, $this->getObject()->getID()); if (!$id) { return null; } return PhabricatorEnv::getProductionURI('/D'.$id); } public function readValueFromCommitMessage($value) { $this->revisionID = $value; } private static function parseRevisionIDFromURI($uri_string) { $uri = new PhutilURI($uri_string); $path = $uri->getPath(); $matches = null; if (preg_match('#^/D(\d+)$#', $path, $matches)) { $id = (int)$matches[1]; $prod_uri = new PhutilURI(PhabricatorEnv::getProductionURI('/D'.$id)); // Make sure the URI is the same as our URI. Basically, we want to ignore // commits from other Phabricator installs. if ($uri->getDomain() == $prod_uri->getDomain()) { return $id; } $allowed_uris = PhabricatorEnv::getAllowedURIs('/D'.$id); foreach ($allowed_uris as $allowed_uri) { if ($uri_string == $allowed_uri) { return $id; } } } return null; } }