Skip to content

Commit 02928ff

Browse files
committed
Setting the Password to an arbitrary value was dumb.
1 parent 85d8d10 commit 02928ff

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

index.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,27 @@
5959

6060
/**
6161
* Double check if a password has been configured. If there has not and we are
62-
* testing the server, exit with HTTP code 401. Otherwise treat it as an empty
63-
* string.
62+
* testing the server, exit with HTTP code 401.
6463
*/
65-
if (!isset($Password) || !is_string($Password)) {
64+
if (
65+
$testing &&
66+
(
67+
!isset($Password) ||
68+
!is_string($Password)
69+
)
70+
) {
6671
if ($testing) {
6772
header($protocol . ' 401 Unauthorized');
6873
exit();
6974
}
70-
$Password = '';
7175
}
7276

7377
/**
7478
* If the client did not submit a password, or the submitted password did not
7579
* match this server's password, exit with HTTP code 403.
7680
*/
7781
if (
82+
!isset($Password) ||
7883
!isset($_POST['password']) ||
7984
$_POST['password'] !== hash('sha512', $Password)
8085
) {

0 commit comments

Comments
 (0)