Skip to content

Commit

Permalink
Git backup: fix minor regressions for #2049
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Oct 8, 2020
1 parent d12b1fc commit e725cc6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function backup()
$url = (string)$mdl->url;
$pos = strpos($url, '//');
// inject credentials in url (either username or username:password, depending on transport)
if (stripos(trim((string)$mdl->$url),'http')) {
if (stripos(trim((string)$mdl->url),'http') === 0) {
$cred = urlencode((string)$mdl->user) . ":" . urlencode((string)$mdl->password);
$url = substr($url,0, $pos+2) . "{$cred}@" . substr($url, $pos+2);
} else {
Expand All @@ -169,7 +169,7 @@ public function backup()
);
if (strpos($pushtxt, '__exit_ok__')) {
$error_type = null;
} elseif (strpos($pushtxt, 'Permission denied')) {
} elseif (strpos($pushtxt, 'Permission denied') || strpos($pushtxt, 'Authentication failed ')) {
$error_type = "authentication failure";
} elseif (strpos($pushtxt, 'WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED')) {
$error_type = "ssh hostkey changed";
Expand Down

0 comments on commit e725cc6

Please sign in to comment.