Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed ->method() with PMA_Util::method()

  • Loading branch information...
commit e6894be57f5735ab525a2f758ad842aacb8ef7bc 1 parent 0829709
@Chanaka Chanaka authored
Showing with 1,453 additions and 1,453 deletions.
  1. +6 −6 db_operations.php
  2. +11 −11 db_printview.php
  3. +3 −3 db_structure.php
  4. +6 −6 db_tables_search.php
  5. +11 −11 db_tracking.php
  6. +10 −10 export.php
  7. +4 −4 import.php
  8. +6 −6 libraries/Index.class.php
  9. +2 −2 libraries/List_Database.class.php
  10. +36 −36 libraries/Table.class.php
  11. +4 −4 libraries/TableSearch.class.php
  12. +46 −46 libraries/Tracker.class.php
  13. +21 −21 libraries/bookmark.lib.php
  14. +5 −5 libraries/build_html_for_db.lib.php
  15. +13 −13 libraries/check_user_privileges.lib.php
  16. +54 −54 libraries/database_interface.lib.php
  17. +9 −9 libraries/db_info.inc.php
  18. +5 −5 libraries/display_export.lib.php
  19. +2 −2 libraries/display_git_revision.lib.php
  20. +7 −7 libraries/display_import.lib.php
  21. +14 −14 libraries/engines/innodb.lib.php
  22. +1 −1  libraries/engines/pbxt.lib.php
  23. +3 −3 libraries/gis/pma_gis_polygon.php
  24. +15 −15 libraries/import.lib.php
  25. +24 −24 libraries/insert_edit.lib.php
  26. +36 −36 libraries/mult_submits.inc.php
  27. +17 −17 libraries/mysql_charsets.lib.php
  28. +6 −6 libraries/navigation_header.inc.php
  29. +32 −32 libraries/operations.lib.php
  30. +5 −5 libraries/plugins/auth/AuthenticationCookie.class.php
  31. +4 −4 libraries/plugins/export/ExportCodegen.class.php
  32. +6 −6 libraries/plugins/export/ExportLatex.class.php
  33. +48 −48 libraries/plugins/export/ExportSql.class.php
  34. +5 −5 libraries/plugins/export/ExportXml.class.php
  35. +4 −4 libraries/plugins/import/ImportCsv.class.php
  36. +14 −14 libraries/plugins/import/ImportDocsql.class.php
  37. +5 −5 libraries/plugins/import/ImportLdi.class.php
  38. +77 −77 libraries/relation.lib.php
  39. +50 −50 libraries/relation_cleanup.lib.php
  40. +17 −17 libraries/rte/rte_events.lib.php
  41. +4 −4 libraries/rte/rte_footer.lib.php
  42. +8 −8 libraries/rte/rte_list.lib.php
  43. +37 −37 libraries/rte/rte_routines.lib.php
  44. +4 −4 libraries/rte/rte_triggers.lib.php
  45. +6 −6 libraries/schema/Dia_Relation_Schema.class.php
  46. +6 −6 libraries/schema/Eps_Relation_Schema.class.php
  47. +4 −4 libraries/schema/Export_Relation_Schema.class.php
  48. +6 −6 libraries/schema/Svg_Relation_Schema.class.php
  49. +5 −5 libraries/schema/Visio_Relation_Schema.class.php
  50. +97 −97 libraries/server_privileges.lib.php
  51. +60 −60 libraries/server_synchronize.lib.php
  52. +6 −6 libraries/sql_query_form.lib.php
  53. +17 −17 libraries/sqlparser.lib.php
  54. +104 −104 libraries/structure.lib.php
  55. +13 −13 libraries/tbl_properties.inc.php
  56. +6 −6 libraries/tbl_views.lib.php
  57. +27 −27 libraries/transformations.lib.php
  58. +10 −10 libraries/user_preferences.lib.php
  59. +4 −4 main.php
  60. +17 −17 navigation.php
  61. +11 −11 pmd_display_field.php
  62. +12 −12 pmd_pdf.php
  63. +19 −19 pmd_relation_new.php
  64. +12 −12 pmd_relation_upd.php
  65. +12 −12 pmd_save_pos.php
  66. +4 −4 querywindow.php
  67. +4 −4 schema_edit.php
  68. +4 −4 server_binlog.php
  69. +7 −7 server_databases.php
  70. +3 −3 server_engines.php
  71. +13 −13 server_privileges.php
  72. +8 −8 server_replication.php
  73. +54 −54 server_status.php
  74. +11 −11 server_variables.php
  75. +19 −19 sql.php
  76. +11 −11 tbl_addfield.php
  77. +10 −10 tbl_alter.php
  78. +7 −7 tbl_change.php
  79. +22 −22 tbl_create.php
  80. +6 −6 tbl_get_field.php
  81. +7 −7 tbl_indexes.php
  82. +6 −6 tbl_move_copy.php
  83. +5 −5 tbl_operations.php
  84. +17 −17 tbl_printview.php
  85. +58 −58 tbl_relation.php
  86. +4 −4 tbl_replace.php
  87. +7 −7 tbl_structure.php
  88. +13 −13 tbl_tracking.php
  89. +2 −2 user_password.php
View
12 db_operations.php
@@ -122,7 +122,7 @@
PMA_relationsCleanupDatabase($db);
// if someday the RENAME DATABASE reappears, do not DROP
- $local_query = 'DROP DATABASE ' . $common_functions->backquote($db) . ';';
+ $local_query = 'DROP DATABASE ' . PMA_Util::backquote($db) . ';';
$sql_query .= "\n" . $local_query;
PMA_DBI_query($local_query);
@@ -166,7 +166,7 @@
$response->addJSON('newname', $_REQUEST['newname']);
$response->addJSON(
'sql_query',
- $common_functions->getMessage(null, $sql_query)
+ PMA_Util::getMessage(null, $sql_query)
);
exit;
}
@@ -200,7 +200,7 @@
echo "\n";
if (isset($message)) {
- echo $common_functions->getMessage($message, $sql_query);
+ echo PMA_Util::getMessage($message, $sql_query);
unset($message);
}
}
@@ -279,9 +279,9 @@
// We only show this if we find something in the new pdf_pages table
$test_query = '
SELECT *
- FROM ' . $common_functions->backquote($GLOBALS['cfgRelation']['db'])
- . '.' . $common_functions->backquote($cfgRelation['pdf_pages']) . '
- WHERE db_name = \'' . $common_functions->sqlAddSlashes($db) . '\'';
+ FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
+ . '.' . PMA_Util::backquote($cfgRelation['pdf_pages']) . '
+ WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
$test_rs = PMA_queryAsControlUser($test_query, null, PMA_DBI_QUERY_STORE);
/*
View
22 db_printview.php
@@ -14,7 +14,7 @@
$header = $response->getHeader();
$header->enablePrintView();
-$common_functions->checkParameters(array('db'));
+PMA_Util::checkParameters(array('db'));
/**
* Defines the url to return to in case of error in a sql statement
@@ -132,9 +132,9 @@
<td class="right">
<?php
if ($merged_size) {
- echo '<i>' . $common_functions->formatNumber($sts_data['TABLE_ROWS'], 0) . '</i>' . "\n";
+ echo '<i>' . PMA_Util::formatNumber($sts_data['TABLE_ROWS'], 0) . '</i>' . "\n";
} else {
- echo $common_functions->formatNumber($sts_data['TABLE_ROWS'], 0) . "\n";
+ echo PMA_Util::formatNumber($sts_data['TABLE_ROWS'], 0) . "\n";
}
?>
</td>
@@ -146,7 +146,7 @@
$tblsize = $sts_data['Data_length'] + $sts_data['Index_length'];
$sum_size += $tblsize;
list($formated_size, $unit)
- = $common_functions->formatByteDown($tblsize, 3, 1);
+ = PMA_Util::formatByteDown($tblsize, 3, 1);
?>
<td class="right nowrap">
<?php echo $formated_size . ' ' . $unit; ?>
@@ -183,7 +183,7 @@
?>
<tr>
<td class="right"><?php echo __('Creation') . ': '; ?></td>
- <td class="right"><?php echo $common_functions->localisedDate(strtotime($sts_data['Create_time'])); ?></td>
+ <td class="right"><?php echo PMA_Util::localisedDate(strtotime($sts_data['Create_time'])); ?></td>
</tr>
<?php
}
@@ -192,7 +192,7 @@
?>
<tr>
<td class="right"><?php echo __('Last update') . ': '; ?></td>
- <td class="right"><?php echo $common_functions->localisedDate(strtotime($sts_data['Update_time'])); ?></td>
+ <td class="right"><?php echo PMA_Util::localisedDate(strtotime($sts_data['Update_time'])); ?></td>
</tr>
<?php
}
@@ -201,7 +201,7 @@
?>
<tr>
<td class="right"><?php echo __('Last check') . ': '; ?></td>
- <td class="right"><?php echo $common_functions->localisedDate(strtotime($sts_data['Check_time'])); ?></td>
+ <td class="right"><?php echo PMA_Util::localisedDate(strtotime($sts_data['Check_time'])); ?></td>
</tr>
<?php
}
@@ -217,10 +217,10 @@
?>
<tr>
<th class="center">
- <?php echo sprintf(_ngettext('%s table', '%s tables', $num_tables), $common_functions->formatNumber($num_tables, 0)); ?>
+ <?php echo sprintf(_ngettext('%s table', '%s tables', $num_tables), PMA_Util::formatNumber($num_tables, 0)); ?>
</th>
<th class="right nowrap">
- <?php echo $common_functions->formatNumber($sum_entries, 0); ?>
+ <?php echo PMA_Util::formatNumber($sum_entries, 0); ?>
</th>
<th class="center">
--
@@ -228,7 +228,7 @@
<?php
if ($cfg['ShowStats']) {
list($sum_formated, $unit)
- = $common_functions->formatByteDown($sum_size, 3, 1);
+ = PMA_Util::formatByteDown($sum_size, 3, 1);
?>
<th class="right nowrap">
<?php echo $sum_formated . ' ' . $unit; ?>
@@ -246,7 +246,7 @@
/**
* Displays the footer
*/
-echo $common_functions->getButton();
+echo PMA_Util::getButton();
echo "<div id='PMA_disable_floating_menubar'></div>\n";
?>
View
6 db_structure.php
@@ -77,7 +77,7 @@
require_once 'libraries/mysql_charsets.lib.php';
$db_collation = PMA_getDbCollation($db);
-$titles = $common_functions->buildActionTitles();
+$titles = PMA_Util::buildActionTitles();
// 1. No tables
@@ -117,7 +117,7 @@
}
$response->addHTML(
- $common_functions->getListNavigator(
+ PMA_Util::getListNavigator(
$total_num_tables, $pos, $_url_params, 'db_structure.php',
'frame_content', $GLOBALS['cfg']['MaxTableList']
)
@@ -307,7 +307,7 @@
// display again the table list navigator
$response->addHTML(
- $common_functions->getListNavigator(
+ PMA_Util::getListNavigator(
$total_num_tables, $pos, $_url_params, 'db_structure.php',
'frame_content', $GLOBALS['cfg']['MaxTableList']
)
View
12 db_tables_search.php
@@ -12,7 +12,7 @@
$db = $_GET['db'];
$table_term = $_GET['table'];
$common_url_query = PMA_generate_common_url($GLOBALS['db']);
-$tables_full = $common_functions->getTableList($db);
+$tables_full = PMA_Util::getTableList($db);
$tables_response = array();
foreach ($tables_full as $key => $table) {
@@ -21,7 +21,7 @@
. htmlspecialchars($link_title)
. ': ' . htmlspecialchars($table['Comment'])
. ' ('
- . $common_functions->formatNumber($table['Rows'], 0)
+ . PMA_Util::formatNumber($table['Rows'], 0)
. ' ' . __('Rows') . ')"' . ' id="quick_'
. htmlspecialchars($table_db . '.' . $table['Name']) . '"'
. ' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
@@ -33,11 +33,11 @@
'id' => 'icon_' . htmlspecialchars($table_db . '.' . $table['Name'])
);
if (PMA_Table::isView($table_db, $table['Name'])) {
- $link .= $common_functions->getImage(
+ $link .= PMA_Util::getImage(
's_views.png', htmlspecialchars($link_title), $attr
);
} else {
- $link .= $common_functions->getImage(
+ $link .= PMA_Util::getImage(
'b_browse.png', htmlspecialchars($link_title), $attr
);
}
@@ -48,12 +48,12 @@
. urlencode($table['Name']) . '&amp;pos=0';
$link .= '<a href="' . $href . '" title="'
. htmlspecialchars(
- $common_functions->getTitleForTarget(
+ PMA_Util::getTitleForTarget(
$GLOBALS['cfg']['DefaultTabTable']
)
. ': ' . $table['Comment']
. ' (' .
- $common_functions->formatNumber($table['Rows'], 0)
+ PMA_Util::formatNumber($table['Rows'], 0)
. ' ' . __('Rows') . ')'
)
. '" id="' . htmlspecialchars($table_db . '.' . $table['Name'])
View
22 db_tracking.php
@@ -60,9 +60,9 @@
// Prepare statement to get HEAD version
$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' .
- $common_functions->backquote($GLOBALS['cfg']['Server']['pmadb']) . '.' .
- $common_functions->backquote($GLOBALS['cfg']['Server']['tracking']) .
- ' WHERE db_name = \'' . $common_functions->sqlAddSlashes($_REQUEST['db']) . '\' ' .
+ PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) . '.' .
+ PMA_Util::backquote($GLOBALS['cfg']['Server']['tracking']) .
+ ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db']) . '\' ' .
' GROUP BY table_name' .
' ORDER BY table_name ASC';
@@ -94,7 +94,7 @@
$drop_image_or_text = '';
if (true == $GLOBALS['cfg']['PropertiesIconic']) {
- $drop_image_or_text .= $common_functions->getImage(
+ $drop_image_or_text .= PMA_Util::getImage(
'b_drop.png',
__('Delete tracking data for this table')
);
@@ -109,10 +109,10 @@
while ($one_result = PMA_DBI_fetch_array($all_tables_result)) {
list($table_name, $version_number) = $one_result;
$table_query = ' SELECT * FROM ' .
- $common_functions->backquote($GLOBALS['cfg']['Server']['pmadb']) . '.' .
- $common_functions->backquote($GLOBALS['cfg']['Server']['tracking']) .
- ' WHERE `db_name` = \'' . $common_functions->sqlAddSlashes($_REQUEST['db'])
- . '\' AND `table_name` = \'' . $common_functions->sqlAddSlashes($table_name)
+ PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) . '.' .
+ PMA_Util::backquote($GLOBALS['cfg']['Server']['tracking']) .
+ ' WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db'])
+ . '\' AND `table_name` = \'' . PMA_Util::sqlAddSlashes($table_name)
. '\' AND `version` = \'' . $version_number . '\'';
$table_result = PMA_queryAsControlUser($table_query);
@@ -159,7 +159,7 @@
$sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
// Get list of tables
-$table_list = $common_functions->getTableList($GLOBALS['db']);
+$table_list = PMA_Util::getTableList($GLOBALS['db']);
// For each table try to get the tracking version
foreach ($table_list as $key => $value) {
@@ -211,7 +211,7 @@
if (PMA_Tracker::getVersion($GLOBALS['db'], $tablename) == -1) {
$my_link = '<a href="tbl_tracking.php?' . $url_query
. '&amp;table=' . htmlspecialchars($tablename) .'">';
- $my_link .= $common_functions->getIcon('eye.png', __('Track table'));
+ $my_link .= PMA_Util::getIcon('eye.png', __('Track table'));
$my_link .= '</a>';
?>
<tr class="noclick <?php echo $style;?>">
@@ -239,7 +239,7 @@
$log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n"
. $entry['statement'] . "\n";
}
- echo $common_functions->getMessage(__('Database Log'), $log);
+ echo PMA_Util::getMessage(__('Database Log'), $log);
}
?>
View
20 export.php
@@ -21,7 +21,7 @@
$GLOBALS[$one_post_param] = $one_post_value;
}
-$common_functions->checkParameters(array('what', 'export_type'));
+PMA_Util::checkParameters(array('what', 'export_type'));
// export class instance, not array of properties, as before
$export_plugin = PMA_getPlugin(
@@ -248,7 +248,7 @@ function PMA_exportOutputHandler($line)
if ($what == 'sql') {
$crlf = "\n";
} else {
- $crlf = $common_functions->whichCrlf();
+ $crlf = PMA_Util::whichCrlf();
}
$output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls';
@@ -318,7 +318,7 @@ function PMA_exportOutputHandler($line)
);
}
}
- $filename = $common_functions->expandUserString($filename_template);
+ $filename = PMA_Util::expandUserString($filename_template);
$filename = PMA_sanitizeFilename($filename);
// Grab basic dump extension and mime type
@@ -350,7 +350,7 @@ function PMA_exportOutputHandler($line)
// Open file on server if needed
if ($save_on_server) {
- $save_filename = $common_functions->userDir($cfg['SaveDir'])
+ $save_filename = PMA_Util::userDir($cfg['SaveDir'])
. preg_replace('@[/\\\\]@', '_', $filename);
unset($message);
if (file_exists($save_filename)
@@ -535,8 +535,8 @@ function PMA_exportOutputHandler($line)
|| $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data')
&& ! ($is_view || PMA_Table::isMerge($current_db, $table))
) {
- $local_query = 'SELECT * FROM ' . $common_functions->backquote($current_db)
- . '.' . $common_functions->backquote($table);
+ $local_query = 'SELECT * FROM ' . PMA_Util::backquote($current_db)
+ . '.' . PMA_Util::backquote($table);
if (! $export_plugin->exportData($current_db, $table, $crlf, $err_url, $local_query)) {
break 3;
}
@@ -614,8 +614,8 @@ function PMA_exportOutputHandler($line)
|| $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data')
&& ! ($is_view || PMA_Table::isMerge($db, $table))
) {
- $local_query = 'SELECT * FROM ' . $common_functions->backquote($db)
- . '.' . $common_functions->backquote($table);
+ $local_query = 'SELECT * FROM ' . PMA_Util::backquote($db)
+ . '.' . PMA_Util::backquote($table);
if (! $export_plugin->exportData($db, $table, $crlf, $err_url, $local_query)) {
break 2;
}
@@ -694,8 +694,8 @@ function PMA_exportOutputHandler($line)
$local_query = $sql_query . $add_query;
PMA_DBI_select_db($db);
} else {
- $local_query = 'SELECT * FROM ' . $common_functions->backquote($db)
- . '.' . $common_functions->backquote($table) . $add_query;
+ $local_query = 'SELECT * FROM ' . PMA_Util::backquote($db)
+ . '.' . PMA_Util::backquote($table) . $add_query;
}
if (! $export_plugin->exportData($db, $table, $crlf, $err_url, $local_query)) {
break;
View
8 import.php
@@ -121,7 +121,7 @@
}
// Check needed parameters
-$common_functions->checkParameters(array('import_type', 'format'));
+PMA_Util::checkParameters(array('import_type', 'format'));
// We don't want anything special in format
$format = PMA_securePath($format);
@@ -215,7 +215,7 @@
if (isset($bookmark_variable) && ! empty($bookmark_variable)) {
$import_text = preg_replace(
'|/\*(.*)\[VARIABLE\](.*)\*/|imsU',
- '${1}' . $common_functions->sqlAddSlashes($bookmark_variable) . '${2}',
+ '${1}' . PMA_Util::sqlAddSlashes($bookmark_variable) . '${2}',
$import_text
);
}
@@ -299,7 +299,7 @@
// sanitize $local_import_file as it comes from a POST
$local_import_file = PMA_securePath($local_import_file);
- $import_file = $common_functions->userDir($cfg['UploadDir'])
+ $import_file = PMA_Util::userDir($cfg['UploadDir'])
. $local_import_file;
} elseif (empty($import_file) || ! is_uploaded_file($import_file)) {
@@ -550,7 +550,7 @@
// There was an error?
if (isset($my_die)) {
foreach ($my_die AS $key => $die) {
- $common_functions->mysqlDie(
+ PMA_Util::mysqlDie(
$die['error'], $die['sql'], '', $err_url, $error
);
}
View
12 libraries/Index.class.php
@@ -535,7 +535,7 @@ static public function getView($table, $schema, $print_mode = false)
if (! $print_mode) {
$r = '<fieldset>';
$r .= '<legend id="index_header">' . __('Indexes');
- $r .= $common_functions->showMySQLDocu(
+ $r .= PMA_Util::showMySQLDocu(
'optimization', 'optimizing-database-structure'
);
@@ -587,13 +587,13 @@ static public function getView($table, $schema, $print_mode = false)
}
$r .= '" ' . $row_span . '>' . ' <a href="tbl_indexes.php'
. PMA_generate_common_url($this_params) . '">'
- . $common_functions->getIcon('b_edit.png', __('Edit')) . '</a>'
+ . PMA_Util::getIcon('b_edit.png', __('Edit')) . '</a>'
. '</td>' . "\n";
$this_params = $GLOBALS['url_params'];
if ($index->getName() == 'PRIMARY') {
$this_params['sql_query'] = 'ALTER TABLE '
- . $common_functions->backquote($table)
+ . PMA_Util::backquote($table)
. ' DROP PRIMARY KEY;';
$this_params['message_to_show']
= __('The primary key has been dropped');
@@ -602,8 +602,8 @@ static public function getView($table, $schema, $print_mode = false)
);
} else {
$this_params['sql_query'] = 'ALTER TABLE '
- . $common_functions->backquote($table) . ' DROP INDEX '
- . $common_functions->backquote($index->getName()) . ';';
+ . PMA_Util::backquote($table) . ' DROP INDEX '
+ . PMA_Util::backquote($index->getName()) . ';';
$this_params['message_to_show'] = sprintf(
__('Index %s has been dropped'), $index->getName()
);
@@ -624,7 +624,7 @@ static public function getView($table, $schema, $print_mode = false)
}
$r .= ' href="sql.php' . PMA_generate_common_url($this_params)
. '" >'
- . $common_functions->getIcon('b_drop.png', __('Drop')) . '</a>'
+ . PMA_Util::getIcon('b_drop.png', __('Drop')) . '</a>'
. '</td>' . "\n";
}
View
4 libraries/List_Database.class.php
@@ -451,7 +451,7 @@ protected function checkAgainstPrivTables()
SELECT DISTINCT `Db` FROM `mysql`.`db`
WHERE `Select_priv` = 'Y'
AND `User`
- IN ('" . $common_functions->sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "', '')";
+ IN ('" . PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . "', '')";
$tmp_mydbs = PMA_DBI_fetch_result(
$local_query, null, null, $GLOBALS['controllink']
);
@@ -511,7 +511,7 @@ protected function checkAgainstPrivTables()
$local_query = 'SELECT DISTINCT `Db` FROM `mysql`.`tables_priv`';
$local_query .= ' WHERE `Table_priv` LIKE \'%Select%\'';
$local_query .= ' AND `User` = \'';
- $local_query .= $common_functions->sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . '\'';
+ $local_query .= PMA_Util::sqlAddSlashes($GLOBALS['cfg']['Server']['user']) . '\'';
$rs = PMA_DBI_try_query($local_query, $GLOBALS['controllink']);
if ($rs && @PMA_DBI_num_rows($rs)) {
while ($row = PMA_DBI_fetch_assoc($rs)) {
View
72 libraries/Table.class.php
@@ -218,8 +218,8 @@ static public function isView($db = null, $table = null)
$result = PMA_DBI_fetch_result(
"SELECT TABLE_NAME
FROM information_schema.VIEWS
- WHERE TABLE_SCHEMA = '" . $common_functions->sqlAddSlashes($db) . "'
- AND TABLE_NAME = '" . $common_functions->sqlAddSlashes($table) . "'"
+ WHERE TABLE_SCHEMA = '" . PMA_Util::sqlAddSlashes($db) . "'
+ AND TABLE_NAME = '" . PMA_Util::sqlAddSlashes($table) . "'"
);
return $result ? true : false;
}
@@ -383,7 +383,7 @@ static function generateFieldSpec($name, $type, $index, $length = '',
$is_timestamp = strpos(strtoupper($type), 'TIMESTAMP') !== false;
- $query = $common_functions->backquote($name) . ' ' . $type;
+ $query = PMA_Util::backquote($name) . ' ' . $type;
if ($length != ''
&& ! preg_match(
@@ -433,10 +433,10 @@ static function generateFieldSpec($name, $type, $index, $length = '',
} else {
// Invalid BOOLEAN value
$query .= ' DEFAULT \''
- . $common_functions->sqlAddSlashes($default_value) . '\'';
+ . PMA_Util::sqlAddSlashes($default_value) . '\'';
}
} else {
- $query .= ' DEFAULT \'' . $common_functions->sqlAddSlashes($default_value) . '\'';
+ $query .= ' DEFAULT \'' . PMA_Util::sqlAddSlashes($default_value) . '\'';
}
break;
case 'NULL' :
@@ -486,14 +486,14 @@ static function generateFieldSpec($name, $type, $index, $length = '',
} // end if (auto_increment)
}
if (!empty($comment)) {
- $query .= " COMMENT '" . $common_functions->sqlAddSlashes($comment) . "'";
+ $query .= " COMMENT '" . PMA_Util::sqlAddSlashes($comment) . "'";
}
// move column
if ($move_to == '-first') { // dash can't appear as part of column name
$query .= ' FIRST';
} elseif ($move_to != '') {
- $query .= ' AFTER ' . $common_functions->backquote($move_to);
+ $query .= ' AFTER ' . PMA_Util::backquote($move_to);
}
return $query;
} // end function
@@ -565,8 +565,8 @@ static public function countRecords($db, $table, $force_exact = false,
// Use try_query because it can fail (when a VIEW is
// based on a table that no longer exists)
$result = PMA_DBI_try_query(
- 'SELECT 1 FROM ' . $common_functions->backquote($db) . '.'
- . $common_functions->backquote($table) . ' LIMIT '
+ 'SELECT 1 FROM ' . PMA_Util::backquote($db) . '.'
+ . PMA_Util::backquote($table) . ' LIMIT '
. $GLOBALS['cfg']['MaxExactCountViews'],
null,
PMA_DBI_QUERY_STORE
@@ -650,27 +650,27 @@ static public function duplicateInfo($work, $pma_table, $get_fields,
$select_parts = array();
$row_fields = array();
foreach ($get_fields as $get_field) {
- $select_parts[] = $common_functions->backquote($get_field);
+ $select_parts[] = PMA_Util::backquote($get_field);
$row_fields[$get_field] = 'cc';
}
$where_parts = array();
foreach ($where_fields as $_where => $_value) {
- $where_parts[] = $common_functions->backquote($_where) . ' = \''
- . $common_functions->sqlAddSlashes($_value) . '\'';
+ $where_parts[] = PMA_Util::backquote($_where) . ' = \''
+ . PMA_Util::sqlAddSlashes($_value) . '\'';
}
$new_parts = array();
$new_value_parts = array();
foreach ($new_fields as $_where => $_value) {
- $new_parts[] = $common_functions->backquote($_where);
- $new_value_parts[] = $common_functions->sqlAddSlashes($_value);
+ $new_parts[] = PMA_Util::backquote($_where);
+ $new_value_parts[] = PMA_Util::sqlAddSlashes($_value);
}
$table_copy_query = '
SELECT ' . implode(', ', $select_parts) . '
- FROM ' . $common_functions->backquote($GLOBALS['cfgRelation']['db']) . '.'
- . $common_functions->backquote($GLOBALS['cfgRelation'][$pma_table]) . '
+ FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.'
+ . PMA_Util::backquote($GLOBALS['cfgRelation'][$pma_table]) . '
WHERE ' . implode(' AND ', $where_parts);
// must use PMA_DBI_QUERY_STORE here, since we execute another
@@ -683,13 +683,13 @@ static public function duplicateInfo($work, $pma_table, $get_fields,
$value_parts = array();
foreach ($table_copy_row as $_key => $_val) {
if (isset($row_fields[$_key]) && $row_fields[$_key] == 'cc') {
- $value_parts[] = $common_functions->sqlAddSlashes($_val);
+ $value_parts[] = PMA_Util::sqlAddSlashes($_val);
}
}
$new_table_query = 'INSERT IGNORE INTO '
- . $common_functions->backquote($GLOBALS['cfgRelation']['db'])
- . '.' . $common_functions->backquote($GLOBALS['cfgRelation'][$pma_table]) . '
+ . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
+ . '.' . PMA_Util::backquote($GLOBALS['cfgRelation'][$pma_table]) . '
(' . implode(', ', $select_parts) . ',
' . implode(', ', $new_parts) . ')
VALUES
@@ -761,7 +761,7 @@ static public function moveCopy($source_db, $source_table, $target_db,
return false;
}
- $source = $common_functions->backquote($source_db) . '.' . $common_functions->backquote($source_table);
+ $source = PMA_Util::backquote($source_db) . '.' . PMA_Util::backquote($source_table);
if (! isset($target_db) || ! strlen($target_db)) {
$target_db = $source_db;
}
@@ -770,7 +770,7 @@ static public function moveCopy($source_db, $source_table, $target_db,
// when moving table from replicated one to not replicated one
PMA_DBI_select_db($target_db);
- $target = $common_functions->backquote($target_db) . '.' . $common_functions->backquote($target_table);
+ $target = PMA_Util::backquote($target_db) . '.' . PMA_Util::backquote($target_table);
// do not create the table if dataonly
if ($what != 'dataonly') {
@@ -798,7 +798,7 @@ static public function moveCopy($source_db, $source_table, $target_db,
$i = 0;
if (empty($analyzed_sql[0]['create_table_fields'])) {
// this is not a CREATE TABLE, so find the first VIEW
- $target_for_view = $common_functions->backquote($target_db);
+ $target_for_view = PMA_Util::backquote($target_db);
while (true) {
if ($parsed_sql[$i]['type'] == 'alpha_reservedWord'
&& $parsed_sql[$i]['data'] == 'VIEW'
@@ -842,7 +842,7 @@ static public function moveCopy($source_db, $source_table, $target_db,
// and change them to the target db, ensuring we stay into
// the $parsed_sql limits
$last = $parsed_sql['len'] - 1;
- $backquoted_source_db = $common_functions->backquote($source_db);
+ $backquoted_source_db = PMA_Util::backquote($source_db);
for (++$i; $i <= $last; $i++) {
if ($parsed_sql[$i]['type'] == $table_delimiter
&& $parsed_sql[$i]['data'] == $backquoted_source_db
@@ -869,8 +869,8 @@ static public function moveCopy($source_db, $source_table, $target_db,
$drop_query = 'DROP TABLE';
}
$drop_query .= ' IF EXISTS '
- . $common_functions->backquote($target_db) . '.'
- . $common_functions->backquote($target_table);
+ . PMA_Util::backquote($target_db) . '.'
+ . PMA_Util::backquote($target_table);
PMA_DBI_query($drop_query);
$GLOBALS['sql_query'] .= "\n" . $drop_query . ';';
@@ -982,24 +982,24 @@ static public function moveCopy($source_db, $source_table, $target_db,
// Get all comments and MIME-Types for current table
$comments_copy_query = 'SELECT
column_name, comment' . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . '
- FROM ' . $common_functions->backquote($GLOBALS['cfgRelation']['db']) . '.' . $common_functions->backquote($GLOBALS['cfgRelation']['column_info']) . '
+ FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util::backquote($GLOBALS['cfgRelation']['column_info']) . '
WHERE
- db_name = \'' . $common_functions->sqlAddSlashes($source_db) . '\' AND
- table_name = \'' . $common_functions->sqlAddSlashes($source_table) . '\'';
+ db_name = \'' . PMA_Util::sqlAddSlashes($source_db) . '\' AND
+ table_name = \'' . PMA_Util::sqlAddSlashes($source_table) . '\'';
$comments_copy_rs = PMA_queryAsControlUser($comments_copy_query);
// Write every comment as new copied entry. [MIME]
while ($comments_copy_row = PMA_DBI_fetch_assoc($comments_copy_rs)) {
- $new_comment_query = 'REPLACE INTO ' . $common_functions->backquote($GLOBALS['cfgRelation']['db']) . '.' . $common_functions->backquote($GLOBALS['cfgRelation']['column_info'])
+ $new_comment_query = 'REPLACE INTO ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_Util::backquote($GLOBALS['cfgRelation']['column_info'])
. ' (db_name, table_name, column_name, comment' . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ') '
. ' VALUES('
- . '\'' . $common_functions->sqlAddSlashes($target_db) . '\','
- . '\'' . $common_functions->sqlAddSlashes($target_table) . '\','
- . '\'' . $common_functions->sqlAddSlashes($comments_copy_row['column_name']) . '\''
- . ($GLOBALS['cfgRelation']['mimework'] ? ',\'' . $common_functions->sqlAddSlashes($comments_copy_row['comment']) . '\','
- . '\'' . $common_functions->sqlAddSlashes($comments_copy_row['mimetype']) . '\','
- . '\'' . $common_functions->sqlAddSlashes($comments_copy_row['transformation']) . '\','
- . '\'' . $common_functions->sqlAddSlashes($comments_copy_row['transformation_options']) . '\'' : '')
+ . '\'' . PMA_Util::sqlAddSlashes($target_db) . '\','
+ . '\'' . PMA_Util::sqlAddSlashes($target_table) . '\','
+ . '\'' . PMA_Util::sqlAddSlashes($comments_copy_row['column_name']) . '\''
+ . ($GLOBALS['cfgRelation']['mimework'] ? ',\'' . PMA_Util::sqlAddSlashes($comments_copy_row['comment']) . '\','
+ . '\'' . PMA_Util::sqlAddSlashes($comments_copy_row['mimetype']) . '\','
+ . '\'' . PMA_Util::sqlAddSlashes($comments_copy_row['transformation']) . '\','
+ . '\'' . PMA_Util::sqlAddSlashes($comments_copy_row['transformation_options']) . '\'' : '')
. ')';
PMA_queryAsControlUser($new_comment_query);
} // end while
View
8 libraries/TableSearch.class.php
@@ -465,10 +465,10 @@ private function _getEnumWhereClause($criteriaValues, $func_type)
$parens_close = '';
}
$enum_where = '\''
- . $common_functions->sqlAddSlashes($criteriaValues[0]) . '\'';
+ . PMA_Util::sqlAddSlashes($criteriaValues[0]) . '\'';
for ($e = 1; $e < $enum_selected_count; $e++) {
$enum_where .= ', \''
- . $common_functions->sqlAddSlashes($criteriaValues[$e]) . '\'';
+ . PMA_Util::sqlAddSlashes($criteriaValues[$e]) . '\'';
}
return ' ' . $func_type . ' ' . $parens_open
@@ -595,7 +595,7 @@ private function _getWhereClause($criteriaValues, $names, $types, $collations,
// quote values one by one
$values = explode(',', $criteriaValues);
foreach ($values as &$value) {
- $value = $quot . $common_functions->sqlAddSlashes(trim($value))
+ $value = $quot . PMA_Util::sqlAddSlashes(trim($value))
. $quot;
}
@@ -609,7 +609,7 @@ private function _getWhereClause($criteriaValues, $names, $types, $collations,
}
} else {
$where = $backquoted_name . ' ' . $func_type . ' ' . $quot
- . $common_functions->sqlAddSlashes($criteriaValues) . $quot;
+ . PMA_Util::sqlAddSlashes($criteriaValues) . $quot;
}
} // end if
View
92 libraries/Tracker.class.php
@@ -94,8 +94,8 @@ class PMA_Tracker
static protected function init()
{
- self::$pma_table = $common_functions->backquote($GLOBALS['cfg']['Server']['pmadb']) .".".
- $common_functions->backquote($GLOBALS['cfg']['Server']['tracking']);
+ self::$pma_table = PMA_Util::backquote($GLOBALS['cfg']['Server']['pmadb']) .".".
+ PMA_Util::backquote($GLOBALS['cfg']['Server']['tracking']);
self::$add_drop_table = $GLOBALS['cfg']['Server']['tracking_add_drop_table'];
@@ -212,8 +212,8 @@ static public function isTracked($dbname, $tablename)
}
$sql_query = " SELECT tracking_active FROM " . self::$pma_table .
- " WHERE db_name = '" . $common_functions->sqlAddSlashes($dbname) . "' " .
- " AND table_name = '" . $common_functions->sqlAddSlashes($tablename) . "' " .
+ " WHERE db_name = '" . PMA_Util::sqlAddSlashes($dbname) . "' " .
+ " AND table_name = '" . PMA_Util::sqlAddSlashes($tablename) . "' " .
" ORDER BY version DESC";
$row = PMA_DBI_fetch_array(PMA_queryAsControlUser($sql_query));
@@ -298,13 +298,13 @@ static public function createVersion($dbname, $tablename, $version,
if (self::$add_drop_table == true && $is_view == false) {
$create_sql .= self::getLogComment()
- . 'DROP TABLE IF EXISTS ' . $common_functions->backquote($tablename) . ";\n";
+ . 'DROP TABLE IF EXISTS ' . PMA_Util::backquote($tablename) . ";\n";
}
if (self::$add_drop_view == true && $is_view == true) {
$create_sql .= self::getLogComment()
- . 'DROP VIEW IF EXISTS ' . $common_functions->backquote($tablename) . ";\n";
+ . 'DROP VIEW IF EXISTS ' . PMA_Util::backquote($tablename) . ";\n";
}
$create_sql .= self::getLogComment() .
@@ -325,15 +325,15 @@ static public function createVersion($dbname, $tablename, $version,
"tracking " .
") " .
"values (
- '" . $common_functions->sqlAddSlashes($dbname) . "',
- '" . $common_functions->sqlAddSlashes($tablename) . "',
- '" . $common_functions->sqlAddSlashes($version) . "',
- '" . $common_functions->sqlAddSlashes($date) . "',
- '" . $common_functions->sqlAddSlashes($date) . "',
- '" . $common_functions->sqlAddSlashes($snapshot) . "',
- '" . $common_functions->sqlAddSlashes($create_sql) . "',
- '" . $common_functions->sqlAddSlashes("\n") . "',
- '" . $common_functions->sqlAddSlashes(self::_transformTrackingSet($tracking_set)) . "' )";
+ '" . PMA_Util::sqlAddSlashes($dbname) . "',
+ '" . PMA_Util::sqlAddSlashes($tablename) . "',
+ '" . PMA_Util::sqlAddSlashes($version) . "',
+ '" . PMA_Util::sqlAddSlashes($date) . "',
+ '" . PMA_Util::sqlAddSlashes($date) . "',
+ '" . PMA_Util::sqlAddSlashes($snapshot) . "',
+ '" . PMA_Util::sqlAddSlashes($create_sql) . "',
+ '" . PMA_Util::sqlAddSlashes("\n") . "',
+ '" . PMA_Util::sqlAddSlashes(self::_transformTrackingSet($tracking_set)) . "' )";
$result = PMA_queryAsControlUser($sql_query);
@@ -362,9 +362,9 @@ static public function deleteTracking($dbname, $tablename)
$sql_query = "/*NOTRACK*/\n"
. "DELETE FROM " . self::$pma_table
. " WHERE `db_name` = '"
- . $common_functions->sqlAddSlashes($dbname) . "'"
+ . PMA_Util::sqlAddSlashes($dbname) . "'"
. " AND `table_name` = '"
- . $common_functions->sqlAddSlashes($tablename) . "'";
+ . PMA_Util::sqlAddSlashes($tablename) . "'";
$result = PMA_queryAsControlUser($sql_query);
return $result;
@@ -399,7 +399,7 @@ static public function createDatabaseVersion($dbname, $version, $query,
if (self::$add_drop_database == true) {
$create_sql .= self::getLogComment()
- . 'DROP DATABASE IF EXISTS ' . $common_functions->backquote($dbname) . ";\n";
+ . 'DROP DATABASE IF EXISTS ' . PMA_Util::backquote($dbname) . ";\n";
}
$create_sql .= self::getLogComment() . $query;
@@ -418,15 +418,15 @@ static public function createDatabaseVersion($dbname, $version, $query,
"tracking " .
") " .
"values (
- '" . $common_functions->sqlAddSlashes($dbname) . "',
- '" . $common_functions->sqlAddSlashes('') . "',
- '" . $common_functions->sqlAddSlashes($version) . "',
- '" . $common_functions->sqlAddSlashes($date) . "',
- '" . $common_functions->sqlAddSlashes($date) . "',
- '" . $common_functions->sqlAddSlashes('') . "',
- '" . $common_functions->sqlAddSlashes($create_sql) . "',
- '" . $common_functions->sqlAddSlashes("\n") . "',
- '" . $common_functions->sqlAddSlashes(self::_transformTrackingSet($tracking_set)) . "' )";
+ '" . PMA_Util::sqlAddSlashes($dbname) . "',
+ '" . PMA_Util::sqlAddSlashes('') . "',
+ '" . PMA_Util::sqlAddSlashes($version) . "',
+ '" . PMA_Util::sqlAddSlashes($date) . "',
+ '" . PMA_Util::sqlAddSlashes($date) . "',
+ '" . PMA_Util::sqlAddSlashes('') . "',
+ '" . PMA_Util::sqlAddSlashes($create_sql) . "',
+ '" . PMA_Util::sqlAddSlashes("\n") . "',
+ '" . PMA_Util::sqlAddSlashes(self::_transformTrackingSet($tracking_set)) . "' )";
$result = PMA_queryAsControlUser($sql_query);
@@ -453,9 +453,9 @@ static private function _changeTracking($dbname, $tablename,
$common_functions= PMA_CommonFunctions::getInstance();
$sql_query = " UPDATE " . self::$pma_table .
" SET `tracking_active` = '" . $new_state . "' " .
- " WHERE `db_name` = '" . $common_functions->sqlAddSlashes($dbname) . "' " .
- " AND `table_name` = '" . $common_functions->sqlAddSlashes($tablename) . "' " .
- " AND `version` = '" . $common_functions->sqlAddSlashes($version) . "' ";
+ " WHERE `db_name` = '" . PMA_Util::sqlAddSlashes($dbname) . "' " .
+ " AND `table_name` = '" . PMA_Util::sqlAddSlashes($tablename) . "' " .
+ " AND `version` = '" . PMA_Util::sqlAddSlashes($version) . "' ";
$result = PMA_queryAsControlUser($sql_query);
@@ -492,7 +492,7 @@ static public function changeTrackingData($dbname, $tablename,
if (is_array($new_data)) {
foreach ($new_data as $data) {
$new_data_processed .= '# log ' . $date . ' ' . $data['username']
- . $common_functions->sqlAddSlashes($data['statement']) . "\n";
+ . PMA_Util::sqlAddSlashes($data['statement']) . "\n";
}
} else {
$new_data_processed = $new_data;
@@ -500,9 +500,9 @@ static public function changeTrackingData($dbname, $tablename,
$sql_query = " UPDATE " . self::$pma_table .
" SET `" . $save_to . "` = '" . $new_data_processed . "' " .
- " WHERE `db_name` = '" . $common_functions->sqlAddSlashes($dbname) . "' " .
- " AND `table_name` = '" . $common_functions->sqlAddSlashes($tablename) . "' " .
- " AND `version` = '" . $common_functions->sqlAddSlashes($version) . "' ";
+ " WHERE `db_name` = '" . PMA_Util::sqlAddSlashes($dbname) . "' " .
+ " AND `table_name` = '" . PMA_Util::sqlAddSlashes($tablename) . "' " .
+ " AND `version` = '" . PMA_Util::sqlAddSlashes($version) . "' ";
$result = PMA_queryAsControlUser($sql_query);
@@ -559,8 +559,8 @@ static public function getVersion($dbname, $tablename, $statement = null)
{
$sql_query = " SELECT MAX(version) FROM " . self::$pma_table .
- " WHERE `db_name` = '" . $common_functions->sqlAddSlashes($dbname) . "' " .
- " AND `table_name` = '" . $common_functions->sqlAddSlashes($tablename) . "' ";
+ " WHERE `db_name` = '" . PMA_Util::sqlAddSlashes($dbname) . "' " .
+ " AND `table_name` = '" . PMA_Util::sqlAddSlashes($tablename) . "' ";
if ($statement != "") {
$sql_query .= PMA_DRIZZLE
@@ -592,12 +592,12 @@ static public function getTrackedData($dbname, $tablename, $version)
self::init();
}
$sql_query = " SELECT * FROM " . self::$pma_table .
- " WHERE `db_name` = '" . $common_functions->sqlAddSlashes($dbname) . "' ";
+ " WHERE `db_name` = '" . PMA_Util::sqlAddSlashes($dbname) . "' ";
if (! empty($tablename)) {
$sql_query .= " AND `table_name` = '"
- . $common_functions->sqlAddSlashes($tablename) ."' ";
+ . PMA_Util::sqlAddSlashes($tablename) ."' ";
}
- $sql_query .= " AND `version` = '" . $common_functions->sqlAddSlashes($version) ."' ".
+ $sql_query .= " AND `version` = '" . PMA_Util::sqlAddSlashes($version) ."' ".
" ORDER BY `version` DESC LIMIT 1";
$mixed = PMA_DBI_fetch_assoc(PMA_queryAsControlUser($sql_query));
@@ -999,16 +999,16 @@ static public function handleQuery($query)
// Mark it as untouchable
$sql_query = " /*NOTRACK*/\n"
. " UPDATE " . self::$pma_table
- . " SET " . $common_functions->backquote($save_to)
- . " = CONCAT( " . $common_functions->backquote($save_to) . ",'\n"
- . $common_functions->sqlAddSlashes($query) . "') ,"
+ . " SET " . PMA_Util::backquote($save_to)
+ . " = CONCAT( " . PMA_Util::backquote($save_to) . ",'\n"
+ . PMA_Util::sqlAddSlashes($query) . "') ,"
. " `date_updated` = '" . $date . "' ";
// If table was renamed we have to change
// the tablename attribute in pma_tracking too
if ($result['identifier'] == 'RENAME TABLE') {
$sql_query .= ', `table_name` = \''
- . $common_functions->sqlAddSlashes($result['tablename_after_rename'])
+ . PMA_Util::sqlAddSlashes($result['tablename_after_rename'])
. '\' ';
}
@@ -1019,9 +1019,9 @@ static public function handleQuery($query)
// we want to track
$sql_query .=
" WHERE FIND_IN_SET('" . $result['identifier'] . "',tracking) > 0" .
- " AND `db_name` = '" . $common_functions->sqlAddSlashes($dbname) . "' " .
- " AND `table_name` = '" . $common_functions->sqlAddSlashes($result['tablename']) . "' " .
- " AND `version` = '" . $common_functions->sqlAddSlashes($version) . "' ";
+ " AND `db_name` = '" . PMA_Util::sqlAddSlashes($dbname) . "' " .
+ " AND `table_name` = '" . PMA_Util::sqlAddSlashes($result['tablename']) . "' " .
+ " AND `version` = '" . PMA_Util::sqlAddSlashes($version) . "' ";
$result = PMA_queryAsControlUser($sql_query);
}
View
42 libraries/bookmark.lib.php
@@ -60,18 +60,18 @@ function PMA_Bookmark_getList($db)
return array();
}
- $query = 'SELECT label, id FROM '. $common_functions->backquote($cfgBookmark['db'])
- . '.' . $common_functions->backquote($cfgBookmark['table'])
- . ' WHERE dbase = \'' . $common_functions->sqlAddSlashes($db) . '\''
- . ' AND user = \'' . $common_functions->sqlAddSlashes($cfgBookmark['user']) . '\''
+ $query = 'SELECT label, id FROM '. PMA_Util::backquote($cfgBookmark['db'])
+ . '.' . PMA_Util::backquote($cfgBookmark['table'])
+ . ' WHERE dbase = \'' . PMA_Util::sqlAddSlashes($db) . '\''
+ . ' AND user = \'' . PMA_Util::sqlAddSlashes($cfgBookmark['user']) . '\''
. ' ORDER BY label';
$per_user = PMA_DBI_fetch_result(
$query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE
);
- $query = 'SELECT label, id FROM '. $common_functions->backquote($cfgBookmark['db'])
- . '.' . $common_functions->backquote($cfgBookmark['table'])
- . ' WHERE dbase = \'' . $common_functions->sqlAddSlashes($db) . '\''
+ $query = 'SELECT label, id FROM '. PMA_Util::backquote($cfgBookmark['db'])
+ . '.' . PMA_Util::backquote($cfgBookmark['table'])
+ . ' WHERE dbase = \'' . PMA_Util::sqlAddSlashes($db) . '\''
. ' AND user = \'\''
. ' ORDER BY label';
$global = PMA_DBI_fetch_result(
@@ -118,19 +118,19 @@ function PMA_Bookmark_get($db, $id, $id_field = 'id', $action_bookmark_all = fal
return '';
}
- $query = 'SELECT query FROM ' . $common_functions->backquote($cfgBookmark['db'])
- . '.' . $common_functions->backquote($cfgBookmark['table'])
- . ' WHERE dbase = \'' . $common_functions->sqlAddSlashes($db) . '\'';
+ $query = 'SELECT query FROM ' . PMA_Util::backquote($cfgBookmark['db'])
+ . '.' . PMA_Util::backquote($cfgBookmark['table'])
+ . ' WHERE dbase = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
if (!$action_bookmark_all) {
- $query .= ' AND (user = \'' . $common_functions->sqlAddSlashes($cfgBookmark['user']) . '\'';
+ $query .= ' AND (user = \'' . PMA_Util::sqlAddSlashes($cfgBookmark['user']) . '\'';
if (!$exact_user_match) {
$query .= ' OR user = \'\'';
}
$query .= ')';
}
- $query .= ' AND ' . $common_functions->backquote($id_field) . ' = ' . $id;
+ $query .= ' AND ' . PMA_Util::backquote($id_field) . ' = ' . $id;
return PMA_DBI_fetch_value($query, 0, 0, $controllink);
} // end of the 'PMA_Bookmark_get()' function
@@ -158,13 +158,13 @@ function PMA_Bookmark_save($fields, $all_users = false)
return false;
}
- $query = 'INSERT INTO ' . $common_functions->backquote($cfgBookmark['db'])
- . '.' . $common_functions->backquote($cfgBookmark['table'])
+ $query = 'INSERT INTO ' . PMA_Util::backquote($cfgBookmark['db'])
+ . '.' . PMA_Util::backquote($cfgBookmark['table'])
. ' (id, dbase, user, query, label)'
- . ' VALUES (NULL, \'' . $common_functions->sqlAddSlashes($fields['dbase']) . '\', '
- . '\'' . ($all_users ? '' : $common_functions->sqlAddSlashes($fields['user'])) . '\', '
- . '\'' . $common_functions->sqlAddSlashes(urldecode($fields['query'])) . '\', '
- . '\'' . $common_functions->sqlAddSlashes($fields['label']) . '\')';
+ . ' VALUES (NULL, \'' . PMA_Util::sqlAddSlashes($fields['dbase']) . '\', '
+ . '\'' . ($all_users ? '' : PMA_Util::sqlAddSlashes($fields['user'])) . '\', '
+ . '\'' . PMA_Util::sqlAddSlashes(urldecode($fields['query'])) . '\', '
+ . '\'' . PMA_Util::sqlAddSlashes($fields['label']) . '\')';
return PMA_DBI_query($query, $controllink);
} // end of the 'PMA_Bookmark_save()' function
@@ -191,9 +191,9 @@ function PMA_Bookmark_delete($db, $id)
return false;
}
- $query = 'DELETE FROM ' . $common_functions->backquote($cfgBookmark['db'])
- . '.' . $common_functions->backquote($cfgBookmark['table'])
- . ' WHERE (user = \'' . $common_functions->sqlAddSlashes($cfgBookmark['user']) . '\''
+ $query = 'DELETE FROM ' . PMA_Util::backquote($cfgBookmark['db'])
+ . '.' . PMA_Util::backquote($cfgBookmark['table'])
+ . ' WHERE (user = \'' . PMA_Util::sqlAddSlashes($cfgBookmark['user']) . '\''
. ' OR user = \'\')'
. ' AND id = ' . $id;
return PMA_DBI_try_query($query, $controllink);
View
10 libraries/build_html_for_db.lib.php
@@ -111,11 +111,11 @@ function PMA_buildHtmlForDb(
$column_order[$stat_name]['footer'] += $current[$stat_name];
}
if ($stat['format'] === 'byte') {
- list($value, $unit) = $common_functions->formatByteDown(
+ list($value, $unit) = PMA_Util::formatByteDown(
$current[$stat_name], 3, 1
);
} elseif ($stat['format'] === 'number') {
- $value = $common_functions->formatNumber(
+ $value = PMA_Util::formatNumber(
$current[$stat_name], 0
);
} else {
@@ -145,7 +145,7 @@ function PMA_buildHtmlForDb(
$replication_info[$type]['Ignore_DB']
);
if (strlen($key) > 0) {
- $out .= $common_functions->getIcon('s_cancel.png', __('Not replicated'));
+ $out .= PMA_Util::getIcon('s_cancel.png', __('Not replicated'));
} else {
$key = array_search(
$current["SCHEMA_NAME"], $replication_info[$type]['Do_DB']
@@ -156,7 +156,7 @@ function PMA_buildHtmlForDb(
&& count($replication_info[$type]['Do_DB']) == 1)
) {
// if ($key != null) did not work for index "0"
- $out .= $common_functions->getIcon('s_success.png', __('Replicated'));
+ $out .= PMA_Util::getIcon('s_success.png', __('Replicated'));
}
}
@@ -178,7 +178,7 @@ function PMA_buildHtmlForDb(
)
. '">'
. ' '
- . $common_functions->getIcon('s_rights.png', __('Check Privileges'))
+ . PMA_Util::getIcon('s_rights.png', __('Check Privileges'))
. '</a></td>';
}
return array($column_order, $out);
View
26 libraries/check_user_privileges.lib.php
@@ -35,13 +35,13 @@
function PMA_analyseShowGrant()
{
- if ($common_functions->cacheExists('is_create_db_priv', true)) {
- $GLOBALS['is_create_db_priv'] = $common_functions->cacheGet('is_create_db_priv', true);
- $GLOBALS['is_process_priv'] = $common_functions->cacheGet('is_process_priv', true);
- $GLOBALS['is_reload_priv'] = $common_functions->cacheGet('is_reload_priv', true);
- $GLOBALS['db_to_create'] = $common_functions->cacheGet('db_to_create', true);
+ if (PMA_Util::cacheExists('is_create_db_priv', true)) {
+ $GLOBALS['is_create_db_priv'] = PMA_Util::cacheGet('is_create_db_priv', true);
+ $GLOBALS['is_process_priv'] = PMA_Util::cacheGet('is_process_priv', true);
+ $GLOBALS['is_reload_priv'] = PMA_Util::cacheGet('is_reload_priv', true);
+ $GLOBALS['db_to_create'] = PMA_Util::cacheGet('db_to_create', true);
$GLOBALS['dbs_where_create_table_allowed']
- = $common_functions->cacheGet('dbs_where_create_table_allowed', true);
+ = PMA_Util::cacheGet('dbs_where_create_table_allowed', true);
return;
}
@@ -69,7 +69,7 @@ function PMA_analyseShowGrant()
strpos($row[0], '.', $db_name_offset) - $db_name_offset
);
$show_grants_dbname
- = $common_functions->unQuote($show_grants_dbname, '`');
+ = PMA_Util::unQuote($show_grants_dbname, '`');
$show_grants_str = substr($row[0], 6, (strpos($row[0], ' ON ') - 6));
if ($show_grants_str == 'RELOAD') {
@@ -98,7 +98,7 @@ function PMA_analyseShowGrant()
// this array may contain wildcards
$GLOBALS['dbs_where_create_table_allowed'][] = $show_grants_dbname;
- $dbname_to_test = $common_functions->backquote($show_grants_dbname);
+ $dbname_to_test = PMA_Util::backquote($show_grants_dbname);
if ($GLOBALS['is_create_db_priv']) {
// no need for any more tests if we already know this
@@ -140,11 +140,11 @@ function PMA_analyseShowGrant()
// must also cacheUnset() them in
// libraries/plugins/auth/AuthenticationCookie.class.php
- $common_functions->cacheSet('is_create_db_priv', $GLOBALS['is_create_db_priv'], true);
- $common_functions->cacheSet('is_process_priv', $GLOBALS['is_process_priv'], true);
- $common_functions->cacheSet('is_reload_priv', $GLOBALS['is_reload_priv'], true);
- $common_functions->cacheSet('db_to_create', $GLOBALS['db_to_create'], true);
- $common_functions->cacheSet(
+ PMA_Util::cacheSet('is_create_db_priv', $GLOBALS['is_create_db_priv'], true);
+ PMA_Util::cacheSet('is_process_priv', $GLOBALS['is_process_priv'], true);
+ PMA_Util::cacheSet('is_reload_priv', $GLOBALS['is_reload_priv'], true);
+ PMA_Util::cacheSet('db_to_create', $GLOBALS['db_to_create'], true);
+ PMA_Util::cacheSet(
'dbs_where_create_table_allowed',
$GLOBALS['dbs_where_create_table_allowed'],
true
View
108 libraries/database_interface.lib.php
@@ -404,13 +404,13 @@ function PMA_DBI_get_tables_full($database, $table = false,
if ($table) {
if (true === $tbl_is_group) {
$sql_where_table = 'AND t.`TABLE_NAME` LIKE \''
- . $common_functions->escapeMysqlWildcards($common_functions->sqlAddSlashes($table)) . '%\'';
+ . PMA_Util::escapeMysqlWildcards(PMA_Util::sqlAddSlashes($table)) . '%\'';
} elseif ('comment' === $tbl_is_group) {
$sql_where_table = 'AND t.`TABLE_COMMENT` LIKE \''
- . $common_functions->escapeMysqlWildcards($common_functions->sqlAddSlashes($table)) . '%\'';
+ . PMA_Util::escapeMysqlWildcards(PMA_Util::sqlAddSlashes($table)) . '%\'';
} else {
$sql_where_table = 'AND t.`TABLE_NAME` = \''
- . $common_functions->sqlAddSlashes($table) . '\'';
+ . PMA_Util::sqlAddSlashes($table) . '\'';
}
} else {
$sql_where_table = '';
@@ -426,7 +426,7 @@ function PMA_DBI_get_tables_full($database, $table = false,
$this_databases = array_map('sqlAddSlashes', $databases);
if (PMA_DRIZZLE) {
- $engine_info = $common_functions->cacheGet('drizzle_engines', true);
+ $engine_info = PMA_Util::cacheGet('drizzle_engines', true);
$stats_join = "LEFT JOIN (SELECT 0 NUM_ROWS) AS stat ON false";
if (isset($engine_info['InnoDB'])
&& $engine_info['InnoDB']['module_library'] == 'innobase'
@@ -549,13 +549,13 @@ function PMA_DBI_get_tables_full($database, $table = false,
foreach ($databases as $each_database) {
if ($table || (true === $tbl_is_group)) {
$sql = 'SHOW TABLE STATUS FROM '
- . $common_functions->backquote($each_database)
+ . PMA_Util::backquote($each_database)
.' LIKE \''
- . $common_functions->escapeMysqlWildcards($common_functions->sqlAddSlashes($table, true))
+ . PMA_Util::escapeMysqlWildcards(PMA_Util::sqlAddSlashes($table, true))
. '%\'';
} else {
$sql = 'SHOW TABLE STATUS FROM '
- . $common_functions->backquote($each_database);
+ . PMA_Util::backquote($each_database);
}
$useStatusCache = false;
@@ -817,7 +817,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
// get table information from information_schema
if ($database) {
$sql_where_schema = 'WHERE `SCHEMA_NAME` LIKE \''
- . $common_functions->sqlAddSlashes($database) . '\'';
+ . PMA_Util::sqlAddSlashes($database) . '\'';
} else {
$sql_where_schema = '';
}
@@ -838,7 +838,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
$sql .= '
FROM data_dictionary.SCHEMAS s';
if ($force_stats) {
- $engine_info = $common_functions->cacheGet('drizzle_engines', true);
+ $engine_info = PMA_Util::cacheGet('drizzle_engines', true);
$stats_join = "LEFT JOIN (SELECT 0 NUM_ROWS) AS stat ON false";
if (isset($engine_info['InnoDB'])
&& $engine_info['InnoDB']['module_library'] == 'innobase'
@@ -855,7 +855,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
}
$sql .= $sql_where_schema . '
GROUP BY s.SCHEMA_NAME
- ORDER BY ' . $common_functions->backquote($sort_by) . ' ' . $sort_order
+ ORDER BY ' . PMA_Util::backquote($sort_by) . ' ' . $sort_order
. $limit;
} else {
$sql = 'SELECT
@@ -881,7 +881,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
}
$sql .= $sql_where_schema . '
GROUP BY BINARY s.SCHEMA_NAME
- ORDER BY BINARY ' . $common_functions->backquote($sort_by) . ' ' . $sort_order
+ ORDER BY BINARY ' . PMA_Util::backquote($sort_by) . ' ' . $sort_order
. $limit;
}
@@ -889,7 +889,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
$mysql_error = PMA_DBI_getError($link);
if (! count($databases) && $GLOBALS['errno']) {
- $common_functions->mysqlDie($mysql_error, $sql);
+ PMA_Util::mysqlDie($mysql_error, $sql);
}
// display only databases also in official database list
@@ -929,7 +929,7 @@ function PMA_DBI_get_databases_full($database = null, $force_stats = false,
$res = PMA_DBI_query(
'SHOW TABLE STATUS FROM '
- . $common_functions->backquote($database_name) . ';'
+ . PMA_Util::backquote($database_name) . ';'
);
while ($row = PMA_DBI_fetch_assoc($res)) {
@@ -1004,19 +1004,19 @@ function PMA_DBI_get_columns_full($database = null, $table = null,
// get columns information from information_schema
if (null !== $database) {
$sql_wheres[] = '`TABLE_SCHEMA` = \''
- . $common_functions->sqlAddSlashes($database) . '\' ';
+ . PMA_Util::sqlAddSlashes($database) . '\' ';
} else {
$array_keys[] = 'TABLE_SCHEMA';
}
if (null !== $table) {
$sql_wheres[] = '`TABLE_NAME` = \''
- . $common_functions->sqlAddSlashes($table) . '\' ';
+ . PMA_Util::sqlAddSlashes($table) . '\' ';
} else {
$array_keys[] = 'TABLE_NAME';
}
if (null !== $column) {
$sql_wheres[] = '`COLUMN_NAME` = \''
- . $common_functions->sqlAddSlashes($column) . '\' ';
+ . PMA_Util::sqlAddSlashes($column) . '\' ';
} else {
$array_keys[] = 'COLUMN_NAME';
}
@@ -1089,9 +1089,9 @@ function PMA_DBI_get_columns_full($database = null, $table = null,
}
$sql = 'SHOW FULL COLUMNS FROM '
- . $common_functions->backquote($database) . '.' . $common_functions->backquote($table);
+ . PMA_Util::backquote($database) . '.' . PMA_Util::backquote($table);
if (null !== $column) {
- $sql .= " LIKE '" . $common_functions->sqlAddSlashes($column, true) . "'";
+ $sql .= " LIKE '" . PMA_Util::sqlAddSlashes($column, true) . "'";
}
$columns = PMA_DBI_fetch_result($sql, 'Field', null, $link);
@@ -1206,15 +1206,15 @@ function PMA_DBI_get_columns_sql($database, $table, $column = null, $full = fals
NULL AS `Privileges`,
column_comment AS `Comment`" : '') . "
FROM data_dictionary.columns
- WHERE table_schema = '" . $common_functions->sqlAddSlashes($database) . "'
- AND table_name = '" . $common_functions->sqlAddSlashes($table) . "'
+ WHERE table_schema = '" . PMA_Util::sqlAddSlashes($database) . "'
+ AND table_name = '" . PMA_Util::sqlAddSlashes($table) . "'
" . (($column != null) ? "
- AND column_name = '" . $common_functions->sqlAddSlashes($column) . "'" : '');
+ AND column_name = '" . PMA_Util::sqlAddSlashes($column) . "'" : '');
// ORDER BY ordinal_position
} else {
$sql = 'SHOW ' . ($full ? 'FULL' : '') . ' COLUMNS
- FROM ' . $common_functions->backquote($database) . '.' . $common_functions->backquote($table)
- . (($column != null) ? "LIKE '" . $common_functions->sqlAddSlashes($column, true) . "'" : '');
+ FROM ' . PMA_Util::backquote($database) . '.' . PMA_Util::backquote($table)
+ . (($column != null) ? "LIKE '" . PMA_Util::sqlAddSlashes($column, true) . "'" : '');
}
return $sql;
}
@@ -1262,8 +1262,8 @@ function PMA_DBI_get_columns($database, $table, $column = null, $full = false,
FROM data_dictionary.indexes i
JOIN data_dictionary.index_parts p
USING (table_schema, table_name)
- WHERE i.table_schema = '" . $common_functions->sqlAddSlashes($database) . "'
- AND i.table_name = '" . $common_functions->sqlAddSlashes($table) . "'
+ WHERE i.table_schema = '" . PMA_Util::sqlAddSlashes($database) . "'
+ AND i.table_name = '" . PMA_Util::sqlAddSlashes($table) . "'
AND i.is_unique
AND NOT i.is_nullable";
$fs = PMA_DBI_fetch_result($sql, 'index_name', null, $link);
@@ -1330,12 +1330,12 @@ function PMA_DBI_get_table_indexes_sql($database, $table, $where = null)
FROM data_dictionary.index_parts ip
LEFT JOIN data_dictionary.indexes i
USING (table_schema, table_name, index_name)
- WHERE table_schema = '" . $common_functions->sqlAddSlashes($database) . "'
- AND table_name = '" . $common_functions->sqlAddSlashes($table) . "'
+ WHERE table_schema = '" . PMA_Util::sqlAddSlashes($database) . "'
+ AND table_name = '" . PMA_Util::sqlAddSlashes($table) . "'
";
} else {
- $sql = 'SHOW INDEXES FROM ' . $common_functions->backquote($database) . '.'
- . $common_functions->backquote($table);
+ $sql = 'SHOW INDEXES FROM ' . PMA_Util::backquote($database) . '.'
+ . PMA_Util::backquote($table);
}
if ($where) {
$sql .= (PMA_DRIZZLE ? ' AND (' : ' WHERE (') . $where . ')';
@@ -1411,22 +1411,22 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
{
if (! defined('PMA_MYSQL_INT_VERSION')) {
- if ($common_functions->cacheExists('PMA_MYSQL_INT_VERSION', true)) {
+ if (PMA_Util::cacheExists('PMA_MYSQL_INT_VERSION', true)) {
define(
'PMA_MYSQL_INT_VERSION',
- $common_functions->cacheGet('PMA_MYSQL_INT_VERSION', true)
+ PMA_Util::cacheGet('PMA_MYSQL_INT_VERSION', true)
);
define(
'PMA_MYSQL_MAJOR_VERSION',
- $common_functions->cacheGet('PMA_MYSQL_MAJOR_VERSION', true)
+ PMA_Util::cacheGet('PMA_MYSQL_MAJOR_VERSION', true)
);
define(
'PMA_MYSQL_STR_VERSION',
- $common_functions->cacheGet('PMA_MYSQL_STR_VERSION', true)
+ PMA_Util::cacheGet('PMA_MYSQL_STR_VERSION', true)
);
define(
'PMA_MYSQL_VERSION_COMMENT',
- $common_functions->cacheGet('PMA_MYSQL_VERSION_COMMENT', true)
+ PMA_Util::cacheGet('PMA_MYSQL_VERSION_COMMENT', true)
);
} else {
$version = PMA_DBI_fetch_single_row(
@@ -1452,22 +1452,22 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
define('PMA_MYSQL_STR_VERSION', '5.00.15');
define('PMA_MYSQL_VERSION_COMMENT', '');
}
- $common_functions->cacheSet(
+ PMA_Util::cacheSet(
'PMA_MYSQL_INT_VERSION',
PMA_MYSQL_INT_VERSION,
true
);
- $common_functions->cacheSet(
+ PMA_Util::cacheSet(
'PMA_MYSQL_MAJOR_VERSION',
PMA_MYSQL_MAJOR_VERSION,
true
);
- $common_functions->cacheSet(
+ PMA_Util::cacheSet(
'PMA_MYSQL_STR_VERSION',
PMA_MYSQL_STR_VERSION,
true
);
- $common_functions->cacheSet(
+ PMA_Util::cacheSet(
'PMA_MYSQL_VERSION_COMMENT',
PMA_MYSQL_VERSION_COMMENT,
true
@@ -1483,7 +1483,7 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
if (! empty($GLOBALS['collation_connection'])) {
PMA_DBI_query("SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE);
$set_collation_con_query = "SET collation_connection = '"
- . $common_functions->sqlAddSlashes($GLOBALS['collation_connection']) . "';";
+ . PMA_Util::sqlAddSlashes($GLOBALS['collation_connection']) . "';";
PMA_DBI_query(
$set_collation_con_query,
$link,
@@ -1499,7 +1499,7 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
}
// Cache plugin list for Drizzle
- if (PMA_DRIZZLE && !$common_functions->cacheExists('drizzle_engines', true)) {
+ if (PMA_DRIZZLE && !PMA_Util::cacheExists('drizzle_engines', true)) {
$sql = "SELECT p.plugin_name, m.module_library
FROM data_dictionary.plugins p
JOIN data_dictionary.modules m USING (module_name)
@@ -1507,7 +1507,7 @@ function PMA_DBI_postConnect($link, $is_controluser = false)
AND p.plugin_name NOT IN ('FunctionEngine', 'schema')
AND p.is_active = 'YES'";
$engines = PMA_DBI_fetch_result($sql, 'plugin_name', null, $link);
- $common_functions->cacheSet('drizzle_engines', $engines, true);
+ PMA_Util::cacheSet('drizzle_engines', $engines, true);
}
}
@@ -1811,8 +1811,8 @@ function PMA_DBI_get_warnings($link = null)
function PMA_isSuperuser()
{
- if ($common_functions->cacheExists('is_superuser', true)) {
- return $common_functions->cacheGet('is_superuser', true);
+ if (PMA_Util::cacheExists('is_superuser', true)) {
+ return PMA_Util::cacheGet('is_superuser', true);
}
// when connection failed we don't have a $userlink
@@ -1832,12 +1832,12 @@ function PMA_isSuperuser()
PMA_DBI_QUERY_STORE
);
}
- $common_functions->cacheSet('is_superuser', $r, true);
+ PMA_Util::cacheSet('is_superuser', $r, true);
} else {
- $common_functions->cacheSet('is_superuser', false, true);
+ PMA_Util::cacheSet('is_superuser', false, true);
}
- return $common_functions->cacheGet('is_superuser', true);
+ return PMA_Util::cacheGet('is_superuser', true);
}
/**
@@ -1884,8 +1884,8 @@ function PMA_DBI_get_definition($db, $which, $name, $link = null)
'VIEW' => 'Create View'
);
$query = 'SHOW CREATE ' . $which . ' '
- . $common_functions->backquote($db) . '.'
- . $common_functions->backquote($name);
+ . PMA_Util::backquote($db) . '.'
+ . PMA_Util::backquote($name);
return(PMA_DBI_fetch_value($query, 0, $returned_field[$which]));
}
@@ -1915,16 +1915,16 @@ function PMA_DBI_get_triggers($db, $table = '', $delimiter = '//')
. ', EVENT_OBJECT_TABLE, ACTION_TIMING, ACTION_STATEMENT'
. ', EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE, DEFINER'
. ' FROM information_schema.TRIGGERS'
- . ' WHERE TRIGGER_SCHEMA= \'' . $common_functions->sqlAddSlashes($db) . '\'';
+ . ' WHERE TRIGGER_SCHEMA= \'' . PMA_Util::sqlAddSlashes($db) . '\'';
if (! empty($table)) {
$query .= " AND EVENT_OBJECT_TABLE = '"
- . $common_functions->sqlAddSlashes($table) . "';";
+ . PMA_Util::sqlAddSlashes($table) . "';";
}
} else {
- $query = "SHOW TRIGGERS FROM " . $common_functions->backquote($db);
+ $query = "SHOW TRIGGERS FROM " . PMA_Util::backquote($db);
if (! empty($table)) {
- $query .= " LIKE '" . $common_functions->sqlAddSlashes($table, true) . "';";
+ $query .= " LIKE '" . PMA_Util::sqlAddSlashes($table, true) . "';";
}
}
@@ -1948,7 +1948,7 @@ function PMA_DBI_get_triggers($db, $table = '', $delimiter = '//')
// do not prepend the schema name; this way, importing the
// definition into another schema will work
- $one_result['full_trigger_name'] = $common_functions->backquote(
+ $one_result['full_trigger_name'] = PMA_Util::backquote(
$trigger['TRIGGER_NAME']
);
$one_result['drop'] = 'DROP TRIGGER IF EXISTS '
@@ -1957,7 +1957,7 @@ function PMA_DBI_get_triggers($db, $table = '', $delimiter = '//')
. $one_result['full_trigger_name'] . ' '
. $trigger['ACTION_TIMING']. ' '
. $trigger['EVENT_MANIPULATION']
- . ' ON ' . $common_functions->backquote($trigger['EVENT_OBJECT_TABLE'])
+ . ' ON ' . PMA_Util::backquote($trigger['EVENT_OBJECT_TABLE'])
. "\n" . ' FOR EACH ROW '
. $trigger['ACTION_STATEMENT'] . "\n" . $delimiter . "\n";
View
18 libraries/db_info.inc.php
@@ -76,23 +76,23 @@ function PMA_fillTooltip(&$tooltip_truename, &$tooltip_aliasname, $table)
if (isset($table['Create_time']) && !empty($table['Create_time'])) {
$tooltip_aliasname[$table['Name']] .= ', ' . __('Creation')
. ': '
- . $common_functions->localisedDate(strtotime($table['Create_time']));
+ . PMA_Util::localisedDate(strtotime($table['Create_time']));
}
if (! empty($table['Update_time'])) {
$tooltip_aliasname[$table['Name']] .= ', ' . __('Last update')
. ': '
- . $common_functions->localisedDate(strtotime($table['Update_time']));
+ . PMA_Util::localisedDate(strtotime($table['Update_time']));
}
if (! empty($table['Check_time'])) {
$tooltip_aliasname[$table['Name']] .= ', ' . __('Last check')
. ': '
- . $common_functions->localisedDate(strtotime($table['Check_time']));
+ . PMA_Util::localisedDate(strtotime($table['Check_time']));
}
}
-$common_functions->checkParameters(array('db'));
+PMA_Util::checkParameters(array('db'));
/**
* @global bool whether to display extended stats
@@ -118,7 +118,7 @@ function PMA_fillTooltip(&$tooltip_truename, &$tooltip_aliasname, $table)
// only show tables matching the given groupname
if (PMA_isValid($tbl_group) && !$cfg['ShowTooltipAliasTB']) {
$tbl_group_sql = ' LIKE "'
- . $common_functions->escapeMysqlWildcards($tbl_group)
+ . PMA_Util::escapeMysqlWildcards($tbl_group)
. '%"';
} else {
$tbl_group_sql = '';
@@ -132,7 +132,7 @@ function PMA_fillTooltip(&$tooltip_truename, &$tooltip_aliasname, $table)
// Special sp