Skip to content

Commit 461b83a

Browse files
authored
Merge pull request #689 from ercoppa/fix_check_disable_authentication
Fix check on disable_authentication in array
2 parents 7e3508e + aae3c99 commit 461b83a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dvwa/includes/dvwaPage.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function dvwaLogin( $pUsername ) {
146146
function dvwaIsLoggedIn() {
147147
global $_DVWA;
148148

149-
if (in_array("disable_authentication", $_DVWA) && $_DVWA['disable_authentication']) {
149+
if (array_key_exists("disable_authentication", $_DVWA) && $_DVWA['disable_authentication']) {
150150
return true;
151151
}
152152
$dvwaSession =& dvwaSessionGrab();
@@ -207,7 +207,7 @@ function dvwaSecurityLevelGet() {
207207

208208
// If not, check to see if authentication is disabled, if it is, use
209209
// the default security level.
210-
if (in_array("disable_authentication", $_DVWA) && $_DVWA['disable_authentication']) {
210+
if (array_key_exists("disable_authentication", $_DVWA) && $_DVWA['disable_authentication']) {
211211
return $_DVWA[ 'default_security_level' ];
212212
}
213213

@@ -633,7 +633,7 @@ function dvwaGuestbook() {
633633
function checkToken( $user_token, $session_token, $returnURL ) { # Validate the given (CSRF) token
634634
global $_DVWA;
635635

636-
if (in_array("disable_authentication", $_DVWA) && $_DVWA['disable_authentication']) {
636+
if (array_key_exists("disable_authentication", $_DVWA) && $_DVWA['disable_authentication']) {
637637
return true;
638638
}
639639

0 commit comments

Comments
 (0)