From fd70d9cdc31881ae7441560a205fb5e49f647ee9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 29 Aug 2019 12:22:38 +0200 Subject: [PATCH] Stripe access tokens in a more generic way --- src/Composer/Util/RemoteFilesystem.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 2e3f4627b..a44d8f86f 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -1128,10 +1128,6 @@ class RemoteFilesystem { // GitHub repository rename result in redirect locations containing the access_token as GET parameter // e.g. https://api.github.com/repositories/9999999999?access_token=github_token - if (preg_match('{^(https?://([a-z0-9-]+\.)*github\.com/.*)\?access_token=[a-z0-9]+}', $url, $matches)) { - return $matches[1]; - } - - return $url; + return preg_replace('{([&?]access_token=)[^&]+}', '$1***', $url); } }