Skip to content

Commit d477c2c

Browse files
committed
check if creds have been found
1 parent 4304bce commit d477c2c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/remote/HttpCommandExecutor.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ public function __construct($url) {
114114

115115
// Get credentials from $url (if any)
116116
preg_match("/^(https?:\/\/)(.*):(.*)@(.*?)/U", $url, $matches);
117-
$url = $matches[1].$matches[4];
118-
$auth_creds = $matches[2].":".$matches[3];
117+
if(array_key_exists($matches[4])){
118+
$url = $matches[1].$matches[4];
119+
$auth_creds = $matches[2].":".$matches[3];
120+
}
119121
print "url:\n$url\n";
120-
//print "matches:\n";
121-
//print_r($matches);
122+
print "matches:\n";
123+
print_r($matches);
122124

123125
$this->url = $url;
124126
$this->curl = curl_init();

0 commit comments

Comments
 (0)