Page MenuHomePhabricator

D15706.id.diff
No OneTemporary

D15706.id.diff

diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -164,7 +164,14 @@
// If authentication credentials have been provided, try to find a user
// that actually matches those credentials.
- if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
+
+ // We require both the username and password to be nonempty, because Git
+ // won't prompt users who provide a username but no password otherwise.
+ // See T10797 for discussion.
+
+ $have_user = strlen(idx($_SERVER, 'PHP_AUTH_USER'));
+ $have_pass = strlen(idx($_SERVER, 'PHP_AUTH_PW'));
+ if ($have_user && $have_pass) {
$username = $_SERVER['PHP_AUTH_USER'];
$password = new PhutilOpaqueEnvelope($_SERVER['PHP_AUTH_PW']);

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 17, 2:58 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309372
Default Alt Text
D15706.id.diff (987 B)

Event Timeline