Fix code to use hostname only, refs #3026

main
Jordi Boggiano 10 years ago
parent 89ec322929
commit 08e34858d6

@ -289,9 +289,10 @@ class Svn
$authConfig = $this->config->get('http-basic');
if (array_key_exists($this->url, $authConfig)) {
$this->credentials['username'] = $authConfig[$this->url]['username'];
$this->credentials['password'] = $authConfig[$this->url]['password'];
$host = parse_url($this->url, PHP_URL_HOST);
if (isset($authConfig[$host])) {
$this->credentials['username'] = $authConfig[$host]['username'];
$this->credentials['password'] = $authConfig[$host]['password'];
return $this->hasAuth = true;
}

@ -60,7 +60,7 @@ class SvnTest extends \PHPUnit_Framework_TestCase
$config->merge(array(
'config' => array(
'http-basic' => array(
$url => array('username' => 'foo', 'password' => 'bar')
'svn.apache.org' => array('username' => 'foo', 'password' => 'bar')
)
)
));

Loading…
Cancel
Save