Make gitlab/bitbucket driver checks case insensitive
parent
34a32c31b4
commit
9e2485aa4d
|
@ -46,7 +46,7 @@ abstract class BitbucketDriver extends VcsDriver
|
||||||
*/
|
*/
|
||||||
public function initialize()
|
public function initialize()
|
||||||
{
|
{
|
||||||
preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)$#', $this->url, $match);
|
preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+?)(\.git|/?)$#i', $this->url, $match);
|
||||||
$this->owner = $match[1];
|
$this->owner = $match[1];
|
||||||
$this->repository = $match[2];
|
$this->repository = $match[2];
|
||||||
$this->originUrl = 'bitbucket.org';
|
$this->originUrl = 'bitbucket.org';
|
||||||
|
|
|
@ -53,7 +53,7 @@ class GitBitbucketDriver extends BitbucketDriver
|
||||||
*/
|
*/
|
||||||
public static function supports(IOInterface $io, Config $config, $url, $deep = false)
|
public static function supports(IOInterface $io, Config $config, $url, $deep = false)
|
||||||
{
|
{
|
||||||
if (!preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#', $url)) {
|
if (!preg_match('#^https?://bitbucket\.org/([^/]+)/(.+?)\.git$#i', $url)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class GitHubDriver extends VcsDriver
|
||||||
preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/(.+?)(?:\.git|/)?$#', $this->url, $match);
|
preg_match('#^(?:(?:https?|git)://([^/]+)/|git@([^:]+):/?)([^/]+)/(.+?)(?:\.git|/)?$#', $this->url, $match);
|
||||||
$this->owner = $match[3];
|
$this->owner = $match[3];
|
||||||
$this->repository = $match[4];
|
$this->repository = $match[4];
|
||||||
$this->originUrl = !empty($match[1]) ? $match[1] : $match[2];
|
$this->originUrl = strtolower(!empty($match[1]) ? $match[1] : $match[2]);
|
||||||
if ($this->originUrl === 'www.github.com') {
|
if ($this->originUrl === 'www.github.com') {
|
||||||
$this->originUrl = 'github.com';
|
$this->originUrl = 'github.com';
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ class GitHubDriver extends VcsDriver
|
||||||
}
|
}
|
||||||
|
|
||||||
$originUrl = !empty($matches[2]) ? $matches[2] : $matches[3];
|
$originUrl = !empty($matches[2]) ? $matches[2] : $matches[3];
|
||||||
if (!in_array(preg_replace('{^www\.}i', '', $originUrl), $config->get('github-domains'))) {
|
if (!in_array(strtolower(preg_replace('{^www\.}i', '', $originUrl)), $config->get('github-domains'))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -494,6 +494,8 @@ class GitLabDriver extends VcsDriver
|
||||||
*/
|
*/
|
||||||
private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber)
|
private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber)
|
||||||
{
|
{
|
||||||
|
$guessedDomain = strtolower($guessedDomain);
|
||||||
|
|
||||||
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array($guessedDomain.':'.$portNumber, $configuredDomains))) {
|
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array($guessedDomain.':'.$portNumber, $configuredDomains))) {
|
||||||
if ($portNumber) {
|
if ($portNumber) {
|
||||||
return $guessedDomain.':'.$portNumber;
|
return $guessedDomain.':'.$portNumber;
|
||||||
|
|
|
@ -53,7 +53,7 @@ class HgBitbucketDriver extends BitbucketDriver
|
||||||
*/
|
*/
|
||||||
public static function supports(IOInterface $io, Config $config, $url, $deep = false)
|
public static function supports(IOInterface $io, Config $config, $url, $deep = false)
|
||||||
{
|
{
|
||||||
if (!preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+)/?$#', $url)) {
|
if (!preg_match('#^https?://bitbucket\.org/([^/]+)/([^/]+)/?$#i', $url)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue