Minor validations in order to avoid warnings

skala
Julio Montoya 13 years ago
parent 57b9e8fac8
commit 9fc9dccf9b
  1. 12
      main/install/install.lib.php

@ -610,10 +610,14 @@ function database_server_connect() {
* @param type $database_name
* @return boolean
*/
function database_exists($database_name) {
$select_database = @Database::select_db($database_name);
$show_database = false;
$result = @Database::query("SHOW DATABASES LIKE '".Database::escape_string($database_name)."' ");
function database_exists($database_name) {
if (empty($database_name)) {
return false;
}
$select_database = @Database::select_db($database_name);
$show_database = false;
$sql = "SHOW DATABASES LIKE '".addslashes($database_name)."'";
$result = @Database::query($sql);
if (Database::num_rows($result)) {
$show_database = true;
}

Loading…
Cancel
Save