diff -r 0b7ff06aad13 -r f3a5a276208c install/includes/stages/database_post.php --- a/install/includes/stages/database_post.php Fri Mar 06 11:19:55 2009 -0500 +++ b/install/includes/stages/database_post.php Sat Mar 14 14:06:02 2009 -0400 @@ -22,6 +22,7 @@ require( ENANO_ROOT . '/includes/sql_parse.php' ); $dbal = new $driver(); $db_host =& $_POST['db_host']; +$db_port =& $_POST['db_port']; $db_user =& $_POST['db_user']; $db_pass =& $_POST['db_pass']; $db_name =& $_POST['db_name']; @@ -36,7 +37,7 @@ return true; } -$result = $dbal->connect(true, $db_host, $db_user, $db_pass, $db_name); +$result = $dbal->connect(true, $db_host, $db_user, $db_pass, $db_name, $db_port); // If connection failed, we have the root login, AND we're on MySQL, try to force our way in if ( !$result && !empty($_POST['db_root_user']) && !empty($_POST['db_root_pass']) && $driver == 'mysql' ) @@ -45,7 +46,7 @@ switch ( 'foo' ) { case 'foo': // Try to connect to the DB as root - $result_root = $dbal->connect(true, $db_host, $db_root_user, $db_root_pass, 'mysql'); + $result_root = $dbal->connect(true, $db_host, $db_root_user, $db_root_pass, 'mysql', $db_port); if ( !$result_root ) break; @@ -68,7 +69,7 @@ break; $dbal->close(); - $result = $dbal->connect(true, $db_host, $db_user, $db_pass, $db_name); + $result = $dbal->connect(true, $db_host, $db_user, $db_pass, $db_name, $db_port); break; } @@ -112,11 +113,17 @@ echo '

That table prefix isn\'t going to work.

'; return true; } + if ( !preg_match('/^[0-9]*$/', $db_port) ) + { + echo '

That port isn\'t going to work.

'; + return true; + } fwrite($ch, "