Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorJIRAAuthProvider.php
| Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | public function getDoorkeeperURIRef(PhutilURI $uri) { | ||||
| $uri_string = phutil_string_cast($uri); | $uri_string = phutil_string_cast($uri); | ||||
| $pattern = '((https?://\S+?)/browse/([A-Z]+-[1-9]\d*))'; | $pattern = '((https?://\S+?)/browse/([A-Z]+-[1-9]\d*))'; | ||||
| $matches = null; | $matches = null; | ||||
| if (!preg_match($pattern, $uri_string, $matches)) { | if (!preg_match($pattern, $uri_string, $matches)) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| if (strlen($uri->getFragment())) { | |||||
| return null; | |||||
| } | |||||
| if ($uri->getQueryParamsAsPairList()) { | |||||
| return null; | |||||
| } | |||||
| $domain = $matches[1]; | $domain = $matches[1]; | ||||
| $issue = $matches[2]; | $issue = $matches[2]; | ||||
| $config = $this->getProviderConfig(); | $config = $this->getProviderConfig(); | ||||
| $base_uri = $config->getProperty(self::PROPERTY_JIRA_URI); | $base_uri = $config->getProperty(self::PROPERTY_JIRA_URI); | ||||
| if ($domain !== rtrim($base_uri, '/')) { | if ($domain !== rtrim($base_uri, '/')) { | ||||
| return null; | return null; | ||||
| Show All 11 Lines | |||||