소스 검색

Stripe access tokens in a more generic way

Jordi Boggiano 5 년 전
부모
커밋
fd70d9cdc3
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      src/Composer/Util/RemoteFilesystem.php

+ 1 - 5
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);
     }
 }