Page MenuHomePhabricator

D15706.diff
No OneTemporary

D15706.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, Feb 3, 1:24 PM (21 h, 38 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7086993
Default Alt Text
D15706.diff (987 B)

Event Timeline