Skip to content

Commit

Permalink
use specified port
Browse files Browse the repository at this point in the history
  • Loading branch information
digininja committed Jul 7, 2020
1 parent b63b458 commit a334d72
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dvwa/includes/DBMS/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
define( 'DVWA_WEB_PAGE_TO_ROOT', '../../../' );
}

if( !@($GLOBALS["___mysqli_ston"] = mysqli_connect( $_DVWA[ 'db_server' ], $_DVWA[ 'db_user' ], $_DVWA[ 'db_password' ] )) ) {
if( !@($GLOBALS["___mysqli_ston"] = mysqli_connect( $_DVWA[ 'db_server' ], $_DVWA[ 'db_user' ], $_DVWA[ 'db_password' ], "", $_DVWA[ 'db_port' ] )) ) {
dvwaMessagePush( "Could not connect to the database service.<br />Please check the config file.<br />Database Error #" . mysqli_connect_errno() . ": " . mysqli_connect_error() . "." );
if ($_DVWA[ 'db_user' ] == "root") {
dvwaMessagePush( 'Your database user is root, if you are using MariaDB, this will not work, please read the README.md file.' );
}
dvwaPageReload();
}


// Create database
$drop_db = "DROP DATABASE IF EXISTS {$_DVWA[ 'db_database' ]};";
if( !@mysqli_query($GLOBALS["___mysqli_ston"], $drop_db ) ) {
Expand Down

0 comments on commit a334d72

Please sign in to comment.