From fc3c01f6283e61cd25d66bf3d6eed32676fa40ae Mon Sep 17 00:00:00 2001 From: Thilina Buddika Date: Thu, 26 Jul 2012 02:45:09 +0530 Subject: [PATCH] modified some of GLOBALS[db] --- db_operations.php | 6 +++--- libraries/db_operations.lib.php | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/db_operations.php b/db_operations.php index d704398265..9c5ca8e0b4 100644 --- a/db_operations.php +++ b/db_operations.php @@ -220,7 +220,7 @@ if (!$is_information_schema) { /** * database comment */ - echo PMA_getHtmlForDatabaseComment(); + echo PMA_getHtmlForDatabaseComment($db); } ?>
@@ -231,7 +231,7 @@ if (!$is_information_schema) { * rename database */ if ($db != 'mysql') { - echo PMA_getHtmlForRenameDatabase(); + echo PMA_getHtmlForRenameDatabase($db); } // Drop link if allowed @@ -241,7 +241,7 @@ if (!$is_information_schema) { && ! $db_is_information_schema && (PMA_DRIZZLE || $db != 'mysql') ) { - echo PMA_getHtmlForDropDatabaseLink(); + echo PMA_getHtmlForDropDatabaseLink($db); } /** * Copy database diff --git a/libraries/db_operations.lib.php b/libraries/db_operations.lib.php index e14921bcdc..ee3a0b6998 100644 --- a/libraries/db_operations.lib.php +++ b/libraries/db_operations.lib.php @@ -14,13 +14,15 @@ if (! defined('PHPMYADMIN')) { /** * Get HTML output for database comment * + * @param $db database name + * * @return string $html_output */ -function PMA_getHtmlForDatabaseComment() +function PMA_getHtmlForDatabaseComment($db) { $html_output = '
' . '
' - . PMA_generate_common_hidden_inputs($GLOBALS['db']) + . PMA_generate_common_hidden_inputs($db) . '
' . ''; if ($GLOBALS['cfg']['PropertiesIconic']) { @@ -29,7 +31,7 @@ function PMA_getHtmlForDatabaseComment() $html_output .= __('Database comment: '); $html_output .= ''; $html_output .= '' + . 'value="' . htmlspecialchars(PMA_getDBComment($db)) . '" />' . '
'; $html_output .= '
' . '' @@ -43,9 +45,11 @@ function PMA_getHtmlForDatabaseComment() /** * Get HTML output for rename database * + * @param $db database name + * * @return string $html_output */ -function PMA_getHtmlForRenameDatabase() +function PMA_getHtmlForRenameDatabase($db) { $html_output = '
' . '' - . PMA_generate_common_hidden_inputs($GLOBALS['db']) + . PMA_generate_common_hidden_inputs($db) . '
' . ''; @@ -82,13 +86,15 @@ function PMA_getHtmlForRenameDatabase() /** * Get HTML for database drop link * + * @param $db database name + * * @return string $html_output */ -function PMA_getHtmlForDropDatabaseLink() +function PMA_getHtmlForDropDatabaseLink($db) { $common_functions = PMA_CommonFunctions::getInstance(); - $this_sql_query = 'DROP DATABASE ' . $common_functions->backquote($GLOBALS['db']); + $this_sql_query = 'DROP DATABASE ' . $common_functions->backquote($db); $this_url_params = array( 'sql_query' => $this_sql_query, 'back' => 'db_operations.php', @@ -97,7 +103,7 @@ function PMA_getHtmlForDropDatabaseLink() 'purge' => '1', 'message_to_show' => sprintf( __('Database %s has been dropped.') - , htmlspecialchars($common_functions->backquote($GLOBALS['db'])) + , htmlspecialchars($common_functions->backquote($db)) ), 'db' => null, );