Skip to content

Commit

Permalink
Merge pull request digininja#321 from digininja/master
Browse files Browse the repository at this point in the history
fixing up undefined and double defined variables
  • Loading branch information
ethicalhack3r authored Sep 29, 2019
2 parents 1d4136a + 52dc94b commit 5f48ecf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dvwa/includes/DBMS/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
*/

define( 'DVWA_WEB_PAGE_TO_ROOT', '../../../' );
if( !defined( 'DVWA_WEB_PAGE_TO_ROOT' ) ) {
define( 'DVWA_WEB_PAGE_TO_ROOT', '../../../' );
}

if( !@($GLOBALS["___mysqli_ston"] = mysqli_connect( $_DVWA[ 'db_server' ], $_DVWA[ 'db_user' ], $_DVWA[ 'db_password' ] )) ) {
dvwaMessagePush( "Could not connect to the MySQL service.<br />Please check the config file." );
Expand Down
8 changes: 7 additions & 1 deletion login.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@

if( isset( $_POST[ 'Login' ] ) ) {
// Anti-CSRF
checkToken( $_REQUEST[ 'user_token' ], $_SESSION[ 'session_token' ], 'login.php' );
if (array_key_exists ("session_token", $_SESSION)) {
$session_token = $_SESSION[ 'session_token' ];
} else {
$session_token = "";
}

checkToken( $_REQUEST[ 'user_token' ], $session_token, 'login.php' );

$user = $_POST[ 'username' ];
$user = stripslashes( $user );
Expand Down
8 changes: 7 additions & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@

if( isset( $_POST[ 'create_db' ] ) ) {
// Anti-CSRF
checkToken( $_REQUEST[ 'user_token' ], $_SESSION[ 'session_token' ], 'setup.php' );
if (array_key_exists ("session_token", $_SESSION)) {
$session_token = $_SESSION[ 'session_token' ];
} else {
$session_token = "";
}

checkToken( $_REQUEST[ 'user_token' ], $session_token, 'setup.php' );

if( $DBMS == 'MySQL' ) {
include_once DVWA_WEB_PAGE_TO_ROOT . 'dvwa/includes/DBMS/MySQL.php';
Expand Down

0 comments on commit 5f48ecf

Please sign in to comment.