Git
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 4 participants
- 39505 discussions
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-6508-gcfdf3aa
by Piotr Przybylski 03 Jul '11
by Piotr Przybylski 03 Jul '11
03 Jul '11
The branch, master has been updated
via cfdf3aa7c346ca90768874bfb7dd5a44920d215f (commit)
from 5560ad53e07d56e6686964de288d487df02a6153 (commit)
- Log -----------------------------------------------------------------
commit cfdf3aa7c346ca90768874bfb7dd5a44920d215f
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Sun Jul 3 13:21:13 2011 +0200
Whitespace cleanup
Removed @uses and fixed broken PHPDoc comments
-----------------------------------------------------------------------
Summary of changes:
libraries/server_synchronize.lib.php | 569 +++++++++++++++++-----------------
1 files changed, 278 insertions(+), 291 deletions(-)
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index a2ea20b..54f15bd 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -2,26 +2,25 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
-* PMA_getMatchingTables places matching tables in source
+* PMA_getMatchingTables places matching tables in source
* and target databases in $matching_tables array whereas
* $uncommon_source_tables array gets the tables present in
* source database but are absent from target database.
* Criterion for matching tables is just comparing their names.
-*
-* @param $trg_tables array of target database table names,
-* @param $src_tables array of source database table names,
-*
-* @param &$matching_tables empty array passed by reference to save names of matching tables,
-* @param &$uncommon_source_tables empty array passed by reference to save names of tables present in
+*
+* @param $trg_tables array of target database table names,
+* @param $src_tables array of source database table names,
+*
+* @param &$matching_tables empty array passed by reference to save names of matching tables,
+* @param &$uncommon_source_tables empty array passed by reference to save names of tables present in
* source database but absent from target database
*/
-
function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables, &$uncommon_source_tables)
{
- for($k=0; $k< sizeof($src_tables); $k++) {
- $present_in_target = false;
- for($l=0; $l < sizeof($trg_tables); $l++) {
- if ($src_tables[$k] === $trg_tables[$l]) {
+ for($k=0; $k< sizeof($src_tables); $k++) {
+ $present_in_target = false;
+ for($l=0; $l < sizeof($trg_tables); $l++) {
+ if ($src_tables[$k] === $trg_tables[$l]) {
$present_in_target = true;
$matching_tables[] = $src_tables[$k];
}
@@ -36,30 +35,29 @@ function PMA_getMatchingTables($trg_tables, $src_tables, &$matching_tables, &$un
* PMA_getNonMatchingTargetTables() places tables present
* in target database but are absent from source database
*
-* @param $trg_tables array of target database table names,
-*
-* @param $matching_tables $matching tables array containing names of matching tables,
-* @param &$uncommon_target_tables empty array passed by reference to save names of tables presnet in
+* @param $trg_tables array of target database table names,
+*
+* @param $matching_tables $matching tables array containing names of matching tables,
+* @param &$uncommon_target_tables empty array passed by reference to save names of tables presnet in
* target database but absent from source database
*/
-
function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, &$uncommon_target_tables)
{
for($c=0; $c<sizeof($trg_tables) ;$c++) {
- $match = false;
+ $match = false;
for($d=0; $d < sizeof($matching_tables); $d++)
{
if ($trg_tables[$c] === $matching_tables[$d]) {
$match=true;
- }
+ }
}
if ($match === false) {
$uncommon_target_tables[] = $trg_tables[$c];
- }
+ }
}
}
-
- /**
+
+/**
* PMA_dataDiffInTables() finds the difference in source and target matching tables by
* first comparing source table's primary key entries with target table enteries.
* It gets the field names for the matching table also for comparisons.
@@ -67,29 +65,27 @@ function PMA_getNonMatchingTargetTables($trg_tables, $matching_tables, &$uncommo
* field values also, in order to check whether update is required or not.
* If update is required, it is placed in $update_array
* Otherwise that entry is placed in the $insert_array.
- *
- *
+ *
+ *
* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
- * @param $index Index of a table from $matching_table array
- *
- * @param $update_array A three dimensional array passed by reference to
+ * @param $matching_table array containing matching table names
+ * @param $matching_tables_fields A two dimensional array passed by reference to contain names of fields for each matching table
+ * @param $update_array A three dimensional array passed by reference to
* contain updates required for each matching table
- * @param $insert_array A three dimensional array passed by reference to
+ * @param $insert_array A three dimensional array passed by reference to
* contain inserts required for each matching table
- * @param $fields_num A two dimensional array passed by reference to
+ * @param $delete_array Unused
+ * @param $fields_num A two dimensional array passed by reference to
* contain number of fields for each matching table
- * @param $matching_table array containing matching table names
- *
- * @param $matching_tables_fields A two dimensional array passed by reference to contain names of fields for each matching table
- *
+ * @param $matching_table_index Index of a table from $matching_table array
* @param $matching_tables_keys A two dimensional array passed by reference to contain names of keys for each matching table
- */
+ */
function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching_table, &$matching_tables_fields,
&$update_array, &$insert_array, &$delete_array, &$fields_num, $matching_table_index, &$matching_tables_keys)
-{
+{
if (isset($matching_table[$matching_table_index])) {
$fld = array();
$fld_results = PMA_DBI_get_columns($src_db, $matching_table[$matching_table_index], true, $src_link);
@@ -101,80 +97,80 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
$is_key[] = $field_name;
}
$fld[] = $field_name;
- }
+ }
}
$matching_tables_fields[$matching_table_index] = $fld;
$fields_num[$matching_table_index] = sizeof($fld);
$matching_tables_keys[$matching_table_index] = $is_key;
-
- $source_result_set = PMA_get_column_values($src_db, $matching_table[$matching_table_index], $is_key, $src_link);
+
+ $source_result_set = PMA_get_column_values($src_db, $matching_table[$matching_table_index], $is_key, $src_link);
$source_size = sizeof($source_result_set);
-
+
$trg_fld_results = PMA_DBI_get_columns($trg_db, $matching_table[$matching_table_index], true, $trg_link);
$all_keys_match = true;
$trg_keys = array();
-
+
if (isset($trg_fld_results)) {
foreach ($trg_fld_results as $each_field) {
if ($each_field['Key'] == 'PRI') {
- $trg_keys[] = $each_field['Field'];
+ $trg_keys[] = $each_field['Field'];
if (! (in_array($each_field['Field'], $is_key))) {
$all_keys_match = false;
- }
- }
- }
+ }
+ }
+ }
}
$update_row = 0;
$insert_row = 0;
$update_field = 0;
$insert_field = 0;
- $starting_index = 0;
-
- for ($j = 0; $j < $source_size; $j++) {
+ $starting_index = 0;
+
+ for ($j = 0; $j < $source_size; $j++) {
$starting_index = 0;
- $update_field = 0;
+ $update_field = 0;
if (isset($source_result_set[$j]) && ($all_keys_match)) {
// Query the target server to see which rows already exist
- $trg_select_query = "SELECT * FROM " . PMA_backquote($trg_db) . "."
+ $trg_select_query = "SELECT * FROM " . PMA_backquote($trg_db) . "."
. PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
-
+
if (sizeof($is_key) == 1) {
$trg_select_query .= $is_key[0]. "='" . $source_result_set[$j] . "'";
} elseif (sizeof($is_key) > 1){
for ($k=0; $k < sizeof($is_key); $k++) {
$trg_select_query .= $is_key[$k] . "='" . $source_result_set[$j][$is_key[$k]] . "'";
if ($k < (sizeof($is_key)-1)){
- $trg_select_query .= " AND ";
+ $trg_select_query .= " AND ";
}
- }
+ }
}
-
+
$target_result_set = PMA_DBI_fetch_result($trg_select_query, null, null, $trg_link);
if ($target_result_set) {
// Fetch the row from the source server to do a comparison
- $src_select_query = "SELECT * FROM " . PMA_backquote($src_db) . "."
+ $src_select_query = "SELECT * FROM " . PMA_backquote($src_db) . "."
. PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
-
+
if (sizeof($is_key) == 1) {
$src_select_query .= $is_key[0] . "='" . $source_result_set[$j] . "'";
} else if(sizeof($is_key) > 1){
for ($k=0; $k< sizeof($is_key); $k++) {
$src_select_query .= $is_key[$k] . "='" . $source_result_set[$j][$is_key[$k]] . "'";
if ($k < (sizeof($is_key) - 1)){
- $src_select_query .= " AND ";
+ $src_select_query .= " AND ";
}
}
- }
-
+ }
+
$src_result_set = PMA_DBI_fetch_result($src_select_query, null, null, $src_link);
-
+
/**
* Comparing each corresponding field of the source and target matching rows.
- * Placing the primary key, value of primary key, field to be updated, and the
- * new value of field to be updated in each row of the update array.
+ * Placing the primary key, value of primary key, field to be updated, and the
+ * new value of field to be updated in each row of the update array.
*/
for ($m = 0; ($m < $fields_num[$matching_table_index]) && ($starting_index == 0) ; $m++) {
if (isset($src_result_set[0][$fld[$m]])) {
@@ -191,12 +187,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
}
}
}
-
+
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
-
+
$update_field++;
if (isset($src_result_set[0][$fld[$m]])) {
- $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
+ $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
$starting_index = $m;
@@ -206,7 +202,7 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
if (sizeof($is_key) == 1) {
if ($source_result_set[$j]) {
$update_array[$matching_table_index][$update_row][$is_key[0]] = $source_result_set[$j];
-
+
}
} elseif (sizeof($is_key) > 1) {
for ($n = 0; $n < sizeof($is_key); $n++) {
@@ -215,12 +211,12 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
}
}
}
-
+
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
-
+
$update_field++;
if (isset($src_result_set[0][$fld[$m]])) {
- $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
+ $update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
$starting_index = $m;
@@ -229,28 +225,28 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
}
}
for ($m = $starting_index + 1; $m < $fields_num[$matching_table_index] ; $m++)
- {
+ {
if (isset($src_result_set[0][$fld[$m]])) {
- if (isset($target_result_set[0][$fld[$m]])) {
+ if (isset($target_result_set[0][$fld[$m]])) {
if (($src_result_set[0][$fld[$m]] != $target_result_set[0][$fld[$m]]) && (!(in_array($fld[$m], $is_key)))) {
- $update_row--;
+ $update_row--;
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
$update_field++;
if ($src_result_set[0][$fld[$m]]) {
$update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
- $update_row++;
+ $update_row++;
}
} else {
- $update_row--;
+ $update_row--;
$update_array[$matching_table_index][$update_row][$update_field] = $fld[$m];
$update_field++;
if ($src_result_set[0][$fld[$m]]) {
$update_array[$matching_table_index][$update_row][$update_field] = $src_result_set[0][$fld[$m]];
$update_field++;
}
- $update_row++;
+ $update_row++;
}
}
}
@@ -262,7 +258,7 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
if (isset($source_result_set[$j])) {
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
+ } elseif (sizeof($is_key) > 1) {
for($l = 0; $l < sizeof($is_key); $l++) {
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
@@ -274,13 +270,13 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
} else {
/**
* Placing the primary key, and the value of primary key of the row that is to be inserted in the target table
- * This condition is met when there is an additional column in the source table
+ * This condition is met when there is an additional column in the source table
*/
if (sizeof($is_key) == 1) {
if (isset($source_result_set[$j])) {
$insert_array[$matching_table_index][$insert_row][$is_key[0]] = $source_result_set[$j];
}
- } elseif (sizeof($is_key) > 1) {
+ } elseif (sizeof($is_key) > 1) {
for ($l = 0; $l < sizeof($is_key); $l++) {
if (isset($source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]])) {
$insert_array[$matching_table_index][$insert_row][$is_key[$l]] = $source_result_set[$j][$matching_tables_fields[$matching_table_index][$l]];
@@ -290,31 +286,31 @@ function PMA_dataDiffInTables($src_db, $trg_db, $src_link, $trg_link, &$matching
$insert_row++;
}
} // for loop ends
- }
-}
+ }
+}
+
/**
* PMA_findDeleteRowsFromTargetTables finds the rows which are to be deleted from target table.
-*
-* @param $delete_array array containing rows that are to be deleted
+*
+* @param $delete_array array containing rows that are to be deleted
* @param $matching_table array containing matching table names
* @param $matching_table_index index of a table from $matching_table array
* @param $trg_keys array of target table keys
* @param $src_keys array of source table keys
* @param $trg_db name of target database
* @param $trg_link connection established with target server
-* @param $src_db name of source database
+* @param $src_db name of source database
* @param $src_link connection established with source server
-*
*/
function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $matching_table_index, $trg_keys, $src_keys, $trg_db, $trg_link,$src_db, $src_link)
{
if (isset($trg_keys[$matching_table_index])) {
$target_key_values = PMA_get_column_values($trg_db, $matching_table[$matching_table_index], $trg_keys[$matching_table_index], $trg_link);
- $target_row_size = sizeof($target_key_values);
+ $target_row_size = sizeof($target_key_values);
}
if (isset($src_keys[$matching_table_index])) {
$source_key_values = PMA_get_column_values($src_db, $matching_table[$matching_table_index], $src_keys[$matching_table_index], $src_link);
- $source_size = sizeof($source_key_values);
+ $source_size = sizeof($source_key_values);
}
$all_keys_match = 1;
for ($a = 0; $a < sizeof($trg_keys[$matching_table_index]); $a++) {
@@ -322,7 +318,7 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
if (! (in_array($trg_keys[$matching_table_index][$a], $src_keys[$matching_table_index]))) {
$all_keys_match = 0;
}
- }
+ }
}
if (! ($all_keys_match)) {
if (isset($target_key_values)) {
@@ -331,17 +327,17 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
}
if (isset($trg_keys[$matching_table_index])) {
if ((sizeof($trg_keys[$matching_table_index]) == 1) && $all_keys_match) {
- $row = 0;
+ $row = 0;
if (isset($target_key_values)) {
for ($i = 0; $i < sizeof($target_key_values); $i++) {
if (! (in_array($target_key_values[$i], $source_key_values))) {
$delete_array[$matching_table_index][$row] = $target_key_values[$i];
- $row++;
+ $row++;
}
- }
+ }
}
} elseif ((sizeof($trg_keys[$matching_table_index]) > 1) && $all_keys_match) {
- $row = 0;
+ $row = 0;
if (isset($target_key_values)) {
for ($i = 0; $i < sizeof($target_key_values); $i++) {
$is_present = false;
@@ -350,7 +346,7 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
for ($k = 0; $k < sizeof($trg_keys[$matching_table_index]); $k++) {
if ($target_key_values[$i][$trg_keys[$matching_table_index][$k]] != $source_key_values[$j][$trg_keys[$matching_table_index][$k]]) {
$check = false;
- }
+ }
}
if ($check) {
$is_present = true;
@@ -362,61 +358,60 @@ function PMA_findDeleteRowsFromTargetTables(&$delete_array, $matching_table, $ma
}
$row++;
}
- }
- }
+ }
+ }
}
- }
+ }
}
/**
* PMA_dataDiffInUncommonTables() finds the data difference in $source_tables_uncommon
-*
+*
* @param $source_tables_uncommon array of table names; containing table names that are in source db and not in target db
* @param $src_db name of source database
* @param $src_link connection established with source server
* @param $index index of a table from $matching_table array
* @param $row_count number of rows
*/
-
function PMA_dataDiffInUncommonTables($source_tables_uncommon, $src_db, $src_link, $index, &$row_count)
{
- $query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "." . PMA_backquote($source_tables_uncommon[$index]);
- $rows = PMA_DBI_fetch_result($query, null, null, $src_link);
- $row_count[$index] = $rows[0];
+ $query = "SELECT COUNT(*) FROM " . PMA_backquote($src_db) . "." . PMA_backquote($source_tables_uncommon[$index]);
+ $rows = PMA_DBI_fetch_result($query, null, null, $src_link);
+ $row_count[$index] = $rows[0];
}
/**
* PMA_updateTargetTables() sets the updated field values to target table rows using $update_array[$matching_table_index]
*
-*
-* @param $table Array containing matching tables' names
+*
+* @param $table Array containing matching tables' names
* @param $update_array A three dimensional array containing field
* value updates required for each matching table
-* @param $src_db Name of source database
+* @param $src_db Name of source database
* @param $trg_db Name of target database
* @param $trg_link Connection established with target server
-* @param $matching_table_index index of matching table in matching_table_array
+* @param $matching_table_index index of matching table in matching_table_array
+* @param $matching_table_keys
* @param $display true/false value
-*/
-
+*/
function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_link, $matching_table_index, $matching_table_keys, $display)
-{
+{
if (isset($update_array[$matching_table_index])) {
if (sizeof($update_array[$matching_table_index])) {
-
+
for ($update_row = 0; $update_row < sizeof($update_array[$matching_table_index]); $update_row++) {
-
- if (isset($update_array[$matching_table_index][$update_row])) {
+
+ if (isset($update_array[$matching_table_index][$update_row])) {
$update_fields_num = sizeof($update_array[$matching_table_index][$update_row])-sizeof($matching_table_keys[$matching_table_index]);
if ($update_fields_num > 0) {
- $query = "UPDATE " . PMA_backquote($trg_db) . "." .PMA_backquote($table[$matching_table_index]) . " SET ";
-
+ $query = "UPDATE " . PMA_backquote($trg_db) . "." .PMA_backquote($table[$matching_table_index]) . " SET ";
+
for ($update_field = 0; $update_field < $update_fields_num; $update_field = $update_field+2) {
if (isset($update_array[$matching_table_index][$update_row][$update_field]) && isset($update_array[$matching_table_index][$update_row][$update_field+1])) {
$query .= $update_array[$matching_table_index][$update_row][$update_field] . "='" . $update_array[$matching_table_index][$update_row][$update_field+1] . "'";
}
if ($update_field < ($update_fields_num - 2)) {
- $query .= ", ";
+ $query .= ", ";
}
}
$query .= " WHERE ";
@@ -424,7 +419,6 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
for ($key = 0; $key < sizeof($matching_table_keys[$matching_table_index]); $key++)
{
if (isset($matching_table_keys[$matching_table_index][$key])) {
-
$query .= $matching_table_keys[$matching_table_index][$key] . "='" . $update_array[$matching_table_index][$update_row][$matching_table_keys[$matching_table_index][$key]] . "'";
}
if ($key < (sizeof($matching_table_keys[$matching_table_index]) - 1)) {
@@ -434,27 +428,26 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
}
if ($display == true) {
echo "<p>" . $query . "</p>";
- }
+ }
PMA_DBI_try_query($query, $trg_link, 0);
}
- }
+ }
}
}
}
}
+
/**
* PMA_insertIntoTargetTable() inserts missing rows in the target table using $array_insert[$matching_table_index]
-*
-*
-*
+*
* @param $matching_table array containing matching table names
* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
* @param $table_fields array containing field names of a table
-* @param $array_insert
-* @param $matching_table_index index of matching table in matching_table_array
+* @param $array_insert
+* @param $matching_table_index index of matching table in matching_table_array
* @param $matching_tables_keys array containing field names that are keys in the matching table
* @param $source_columns array containing source column information
* @param $add_column_array array containing column names that are to be added in target table
@@ -463,30 +456,29 @@ function PMA_updateTargetTables($table, $update_array, $src_db, $trg_db, $trg_li
* @param $uncommon_tables array containing table names that are present in source db but not in targt db
* @param $uncommon_tables_fields array containing field names of the uncommon tables
* @param $uncommon_cols column names that are present in target table and not in source table
-* @param $alter_str_array array containing column names that are to be altered
-* @param $source_indexes column names on which indexes are made in source table
-* @param $target_indexes column names on which indexes are made in target table
+* @param $alter_str_array array containing column names that are to be altered
+* @param $source_indexes column names on which indexes are made in source table
+* @param $target_indexes column names on which indexes are made in target table
* @param $add_indexes_array array containing column names on which index is to be added in target table
-* @param $alter_indexes_array array containing column names whose indexes are to be altered. Only index name and uniqueness of an index can be changed
+* @param $alter_indexes_array array containing column names whose indexes are to be altered. Only index name and uniqueness of an index can be changed
* @param $delete_array array containing rows that are to be deleted
* @param $update_array array containing rows that are to be updated in target
* @param $display true/false value
-*
*/
function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, &$array_insert, $matching_table_index,
- $matching_tables_keys, $source_columns, &$add_column_array, $criteria, $target_tables_keys, $uncommon_tables, &$uncommon_tables_fields,$uncommon_cols,
+ $matching_tables_keys, $source_columns, &$add_column_array, $criteria, $target_tables_keys, $uncommon_tables, &$uncommon_tables_fields,$uncommon_cols,
&$alter_str_array,&$source_indexes, &$target_indexes, &$add_indexes_array, &$alter_indexes_array, &$delete_array, &$update_array, $display)
-{
+{
if(isset($array_insert[$matching_table_index])) {
if (sizeof($array_insert[$matching_table_index])) {
for ($insert_row = 0; $insert_row< sizeof($array_insert[$matching_table_index]); $insert_row++) {
if (isset($array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][0]])) {
-
+
$select_query = "SELECT * FROM " . PMA_backquote($src_db) . "." . PMA_backquote($matching_table[$matching_table_index]) . " WHERE ";
for ($i = 0; $i < sizeof($matching_tables_keys[$matching_table_index]); $i++) {
$select_query .= $matching_tables_keys[$matching_table_index][$i] . "='";
$select_query .= $array_insert[$matching_table_index][$insert_row][$matching_tables_keys[$matching_table_index][$i]] . "'" ;
-
+
if ($i < (sizeof($matching_tables_keys[$matching_table_index]) - 1)) {
$select_query.= " AND ";
}
@@ -494,38 +486,38 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
$select_query .= "; ";
$result = PMA_DBI_fetch_result ($select_query, null, null, $src_link);
$insert_query = "INSERT INTO " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_table[$matching_table_index]) ." (";
-
- for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++)
+
+ for ($field_index = 0; $field_index < sizeof($table_fields[$matching_table_index]); $field_index++)
{
$insert_query .= $table_fields[$matching_table_index][$field_index];
-
- $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db ."'
+
+ $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db ."'
AND TABLE_NAME = '" . $matching_table[$matching_table_index]. "'AND COLUMN_NAME = '" .
$table_fields[$matching_table_index][$field_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $trg_link);
if (sizeof($is_fk_result) > 0) {
for ($j = 0; $j < sizeof($is_fk_result); $j++)
{
$table_index = array_keys($matching_table, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
-
+
if (isset($alter_str_array[$table_index[0]])) {
PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, $source_columns, $alter_str_array, $matching_tables_fields,
$criteria, $matching_tables_keys, $target_tables_keys, $table_index[0], $display);
- unset($alter_str_array[$table_index[0]]);
- }
+ unset($alter_str_array[$table_index[0]]);
+ }
if (isset($uncommon_columns[$table_index[0]])) {
PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_index[0], $display);
- unset($uncommon_columns[$table_index[0]]);
- }
+ unset($uncommon_columns[$table_index[0]]);
+ }
if (isset($add_column_array[$table_index[0]])) {
PMA_findDeleteRowsFromTargetTables($delete_array, $matching_tables, $table_index[0], $target_tables_keys, $matching_tables_keys,
$trg_db, $trg_link, $src_db, $src_link);
-
+
if (isset($delete_array[$table_index[0]])) {
PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index[0], $target_tables_keys, $delete_array, $display);
- unset($delete_array[$table_index[0]]);
- }
+ unset($delete_array[$table_index[0]]);
+ }
PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $matching_tables, $source_columns, $add_column_array,
$matching_tables_fields, $criteria, $matching_tables_keys, $target_tables_keys, $uncommon_tables,$uncommon_tables_fields,
$table_index[0], $uncommon_cols, $display);
@@ -535,7 +527,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
|| isset($alter_indexes_array[$table_index[0]])) {
PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
$remove_indexes_array, $table_index[0], $display);
-
+
unset($add_indexes_array[$table_index[0]]);
unset($alter_indexes_array[$table_index[0]]);
unset($remove_indexes_array[$table_index[0]]);
@@ -548,16 +540,16 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
if (isset($array_insert[$table_index[0]])) {
PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, $trg_link, $table_fields, $array_insert,
$table_index[0], $matching_tables_keys, $source_columns, $add_column_array, $criteria, $target_tables_keys, $uncommon_tables,
- $uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes, $target_indexes, $add_indexes_array,
- $alter_indexes_array, $delete_array, $update_array, $display);
+ $uncommon_tables_fields, $uncommon_cols, $alter_str_array, $source_indexes, $target_indexes, $add_indexes_array,
+ $alter_indexes_array, $delete_array, $update_array, $display);
unset($array_insert[$table_index[0]]);
- }
+ }
}
}
if ($field_index < sizeof($table_fields[$matching_table_index])-1) {
$insert_query .= ", ";
}
- }
+ }
$insert_query .= ") VALUES(";
if (sizeof($table_fields[$matching_table_index]) == 1) {
$insert_query .= "'" . PMA_sqlAddSlashes($result[0]) . "'";
@@ -570,32 +562,32 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link,
}
if ($field_index < (sizeof($table_fields[$matching_table_index])) - 1) {
$insert_query .= " ," ;
- }
+ }
}
- }
+ }
$insert_query .= ");";
if ($display == true) {
PMA_displayQuery($insert_query);
}
PMA_DBI_try_query($insert_query, $trg_link, 0);
- }
+ }
}
}
}
-}
+}
+
/**
-* PMA_createTargetTables() Create the missing table $uncommon_table in target database
-*
-*
-* @param $src_db name of source database
+* PMA_createTargetTables() Create the missing table $uncommon_table in target database
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
-* @param $trg_link connection established with target server
* @param $src_link connection established with source server
-* @param $uncommon_table name of table present in source but not in target
-* @param $table_index index of table in matching_table_array
+* @param $trg_link connection established with target server
+* @param $uncommon_tables names of tables present in source but not in target
+* @param $table_index index of table in $uncommon_tables array
* @param $uncommon_tables_fields field names of the uncommon table
-* @param $display true/false value
-*/
+* @param $display true/false value
+*/
function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncommon_tables, $table_index, &$uncommon_tables_fields, $display)
{
if (isset($uncommon_tables[$table_index])) {
@@ -605,20 +597,20 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$field_name = $each_field['Field'];
$fields[] = $field_name;
}
- $uncommon_tables_fields[$table_index] = $fields;
-
+ $uncommon_tables_fields[$table_index] = $fields;
+
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
// Replace the src table name with a `dbname`.`tablename`
- $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
+ $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]),
$Create_Query,
$limit = 1
);
- $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
+ $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
AND TABLE_NAME = '" . $uncommon_tables[$table_index] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;" ;
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
if (sizeof($is_fk_result) > 0) {
for ($j = 0; $j < sizeof($is_fk_result); $j++)
@@ -627,35 +619,35 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
unset($uncommon_tables[$table_index[0]]);
- }
+ }
}
}
if ($display == true) {
echo '<p>' . $Create_Table_Query . '</p>';
}
PMA_DBI_try_query($Create_Table_Query, $trg_link, 0);
- }
+ }
}
/**
* PMA_populateTargetTables() inserts data into uncommon tables after they have been created
-*
+*
* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
-* @param $uncommon_tables array containing uncommon table names (table names that are present in source but not in target db)
-* @param $table_index index of table in matching_table_array
+* @param $uncommon_tables array containing uncommon table names (table names that are present in source but not in target db)
+* @param $table_index index of table in matching_table_array
* @param $uncommon_tables_fields field names of the uncommon table
* @param $display true/false value
*
* FIXME: This turns NULL values into '' (empty string)
*/
-function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncommon_tables, $table_index, $uncommon_tables_fields, $display)
-{
+function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncommon_tables, $table_index, $uncommon_tables_fields, $display)
+{
$display = false; // todo: maybe display some of the queries if they are not too numerous
$unbuffered_result = PMA_DBI_try_query('SELECT * FROM ' . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), $src_link, PMA_DBI_QUERY_UNBUFFERED);
if (false !== $unbuffered_result) {
- $insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
+ $insert_query = 'INSERT INTO ' . PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]) . ' VALUES';
while ($one_row = PMA_DBI_fetch_row($unbuffered_result)) {
$insert_query .= '(';
$key_of_last_value = count($one_row) - 1;
@@ -675,55 +667,56 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncom
PMA_DBI_try_query($insert_query, $trg_link, 0);
}
}
+
/**
* PMA_deleteFromTargetTable() delete rows from target table
-*
-*
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing matching table names
* @param $table_index index of table in matching_table_array
-* @param $target_table_keys primary key names of the target tables
-* @param $delete array array containing the key values of rows that are to be deleted
+* @param $target_tables_keys primary key names of the target tables
+* @param $delete_array array containing the key values of rows that are to be deleted
* @param $display true/false value
*/
-function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index, $target_tables_keys, $delete_array, $display)
+function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_index, $target_tables_keys, $delete_array, $display)
{
for($i = 0; $i < sizeof($delete_array[$table_index]); $i++) {
if (isset($target_tables_keys[$table_index])) {
- $delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
+ $delete_query = 'DELETE FROM ' . PMA_backquote($trg_db) . '.' .PMA_backquote($matching_tables[$table_index]) . ' WHERE ';
for($y = 0; $y < sizeof($target_tables_keys[$table_index]); $y++) {
$delete_query .= $target_tables_keys[$table_index][$y] . " = '";
-
+
if (sizeof($target_tables_keys[$table_index]) == 1) {
- $delete_query .= $delete_array[$table_index][$i] . "'";
+ $delete_query .= $delete_array[$table_index][$i] . "'";
} elseif (sizeof($target_tables_keys[$table_index]) > 1) {
$delete_query .= $delete_array[$table_index][$i][$target_tables_keys[$table_index][$y]] . "'";
}
if ($y < (sizeof($target_tables_keys[$table_index]) - 1)) {
$delete_query .= ' AND ';
}
- $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
+ $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
AND REFERENCED_TABLE_NAME = '" . $matching_tables[$table_index]."' AND REFERENCED_COLUMN_NAME = '"
. $target_tables_keys[$table_index][$y] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
$result_size = sizeof($pk_query_result);
-
+
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
$drop_pk_query = "DELETE FROM " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . " WHERE " . $pk_query_result[$b]['COLUMN_NAME'] . " = " . $target_tables_keys[$table_index][$y] . ";";
PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
- }
- }
- }
+ }
+ }
+ }
}
if ($display == true) {
- echo '<p>' . $delete_query . '</p>';
+ echo '<p>' . $delete_query . '</p>';
}
PMA_DBI_try_query($delete_query, $trg_link, 0);
}
}
+
/**
* PMA_structureDiffInTables() Gets all the column information for source and target table.
* Compare columns on their names.
@@ -732,10 +725,9 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
* If column exists in target table but criteria is different then it is palced in $alter_str_array.
* If column does not exist in source table but is present in target table then it is placed in $uncommon_columns.
* Keys for all the source tables that have a corresponding target table are placed in $matching_tables_keys.
-* Keys for all the target tables that have a corresponding source table are placed in $target_tables_keys.
-*
-*
-* @param $src_db name of source database
+* Keys for all the target tables that have a corresponding source table are placed in $target_tables_keys.
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
@@ -749,26 +741,25 @@ function PMA_deleteFromTargetTable($trg_db, $trg_link, $matching_tables, $table_
* @param $uncommon_columns array containing the columns that are present in the target table but not in the source table
* @param $criteria array containing the criterias which are to be checked for field that is present in source table and target table
* @param $target_tables_keys array containing the field names which is key in the target table
-* @param $matching_table_index integer number of the matching table
-*
+* @param $matching_table_index integer number of the matching table
*/
function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matching_tables, &$source_columns, &$target_columns, &$alter_str_array,
- &$add_column_array, &$uncommon_columns, $criteria, &$target_tables_keys, $matching_table_index)
+ &$add_column_array, &$uncommon_columns, $criteria, &$target_tables_keys, $matching_table_index)
{
//Gets column information for source and target table
$source_columns[$matching_table_index] = PMA_DBI_get_columns_full($src_db, $matching_tables[$matching_table_index], null, $src_link);
$target_columns[$matching_table_index] = PMA_DBI_get_columns_full($trg_db, $matching_tables[$matching_table_index], null, $trg_link);
foreach ($source_columns[$matching_table_index] as $column_name => $each_column) {
if (isset($target_columns[$matching_table_index][$column_name]['Field'])) {
- //If column exists in target table then matches criterias like type, null, collation, key, default, comment of the column
+ //If column exists in target table then matches criterias like type, null, collation, key, default, comment of the column
for ($i = 0; $i < sizeof($criteria); $i++) {
if ($source_columns[$matching_table_index][$column_name][$criteria[$i]] != $target_columns[$matching_table_index][$column_name][$criteria[$i]]) {
if (($criteria[$i] == 'Default') && ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == '' )) {
- $alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';
+ $alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = 'None';
} else {
if (! (($criteria[$i] == 'Key') && (($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')
- || ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')
- || ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')
+ || ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'MUL')
+ || ($source_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')
|| ($target_columns[$matching_table_index][$column_name][$criteria[$i]] == 'UNI')))) {
$alter_str_array[$matching_table_index][$column_name][$criteria[$i]] = $source_columns[$matching_table_index][$column_name][$criteria[$i]];
}
@@ -782,23 +773,23 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matc
//Finds column names that are present in target table but not in source table
foreach ($target_columns[$matching_table_index] as $fld_name => $each_column) {
if (! (isset($source_columns[$matching_table_index][$fld_name]['Field']))) {
- $fields_uncommon[] = $fld_name;
+ $fields_uncommon[] = $fld_name;
}
if ($target_columns[$matching_table_index][$fld_name]['Key'] == 'PRI') {
$keys[] = $fld_name;
}
}
if (isset($fields_uncommon)) {
- $uncommon_columns[$matching_table_index] = $fields_uncommon;
+ $uncommon_columns[$matching_table_index] = $fields_uncommon;
}
if (isset($keys)) {
- $target_tables_keys[$matching_table_index] = $keys;
+ $target_tables_keys[$matching_table_index] = $keys;
}
}
/**
* PMA_addColumnsInTargetTable() adds column that are present in source table but not in target table
*
-* @param $src_db name of source database
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
@@ -806,7 +797,7 @@ function PMA_structureDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matc
* @param $source_columns array containing columns information of the source tables
* @param $add_column_array array containing the names of the column(field) that are to be added in the target
* @param $matching_tables_fields
-* @param $criteria array containing the criterias
+* @param $criteria array containing the criterias
* @param $matching_tables_keys array containing the field names which is key in the source table
* @param $target_tables_keys array containing the field names which is key in the target table
* @param $uncommon_tables array containing the table names that are present in source db and not in target db
@@ -826,7 +817,7 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
if($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Null'] == 'NO') {
$query .= ' Not Null ';
} elseif ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Null'] == 'YES') {
- $query .= ' Null ';
+ $query .= ' Null ';
}
if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Collation'] != '') {
$query .= ' COLLATE ' . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Collation'];
@@ -835,21 +826,21 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
$query .= " DEFAULT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Default'];
}
if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'] != '') {
- $query .= " COMMENT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'];
- }
- if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Key'] == 'PRI' ) {
+ $query .= " COMMENT " . $source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Comment'];
+ }
+ if ($source_columns[$table_counter][$matching_tables_fields[$table_counter][$i]]['Key'] == 'PRI' ) {
$trg_key_size = sizeof($target_tables_keys[$table_counter]);
if ($trg_key_size) {
$check = true;
- for ($a = 0; ($a < $trg_key_size) && ($check); $a++) {
+ for ($a = 0; ($a < $trg_key_size) && ($check); $a++) {
if (! (in_array($target_tables_keys[$table_counter], $uncommon_cols))) {
$check = false;
- }
+ }
}
if (! $check) {
- $query .= " ,DROP PRIMARY KEY " ;
+ $query .= " ,DROP PRIMARY KEY " ;
}
- }
+ }
$query .= " , ADD PRIMARY KEY (";
for ($t = 0; $t < sizeof($matching_tables_keys[$table_counter]); $t++) {
$query .= $matching_tables_keys[$table_counter][$t];
@@ -859,20 +850,20 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
}
$query .= ")";
}
-
+
$query .= ";";
if ($display == true) {
echo '<p>' . $query . '</p>';
}
PMA_DBI_try_query($query, $trg_link, 0);
-
+
//Checks if column to be added is a foreign key or not
$is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
. $matching_tables[$table_counter] . "' AND COLUMN_NAME ='" . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] .
"' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
-
+
//If column is a foreign key then it is checked that referenced table exist in target db. If referenced table does not exist in target db then
//it is created first.
if (isset($is_fk_result)) {
@@ -886,8 +877,8 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
"ADD CONSTRAINT FOREIGN KEY " . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] . "
(" . $add_column_array[$table_counter][$matching_tables_fields[$table_counter][$i]] . ") REFERENCES " . PMA_backquote($trg_db) .
'.' . PMA_backquote($is_fk_result[0]['REFERENCED_TABLE_NAME']) . " (" . $is_fk_result[0]['REFERENCED_COLUMN_NAME'] . ");";
-
- PMA_DBI_try_query($fk_query, $trg_link, null);
+
+ PMA_DBI_try_query($fk_query, $trg_link, null);
}
}
}
@@ -895,44 +886,43 @@ function PMA_addColumnsInTargetTable($src_db, $trg_db, $src_link, $trg_link, $ma
/**
* PMA_checkForeignKeys() checks if the referenced table have foreign keys.
* uses PMA_createTargetTables()
-*
+*
* @param $src_db name of source database
* @param $src_link connection established with source server
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $referenced_table table whose column is a foreign key in another table
-* @param $uncommon_tables array containing names that are uncommon
+* @param $uncommon_tables array containing names that are uncommon
* @param $uncommon_tables_fields field names of the uncommon table
* @param $display true/false value
*/
function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link ,$referenced_table, &$uncommon_tables, &$uncommon_tables_fields, $display)
{
- $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
+ $is_fk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $src_db . "'
AND TABLE_NAME = '" . $referenced_table . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$is_fk_result = PMA_DBI_fetch_result($is_fk_query, null, null, $src_link);
if (sizeof($is_fk_result) > 0) {
for ($j = 0; $j < sizeof($is_fk_result); $j++) {
if (in_array($is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables)) {
$table_index = array_keys($uncommon_tables, $is_fk_result[$j]['REFERENCED_TABLE_NAME']);
- PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link, $is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables,
- $uncommon_tables_fields, $display);
+ PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link, $is_fk_result[$j]['REFERENCED_TABLE_NAME'], $uncommon_tables,
+ $uncommon_tables_fields, $display);
PMA_createTargetTables($src_db, $trg_db, $trg_link, $src_link, $uncommon_tables, $table_index[0], $uncommon_tables_fields, $display);
unset($uncommon_tables[$table_index[0]]);
- }
+ }
}
}
}
/**
* PMA_alterTargetTableStructure() alters structure of the target table using $alter_str_array
-*
-*
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing names of matching tables
* @param $source_columns array containing columns information of the source table
* @param $alter_str_array array containing the column name and criteria which is to be altered for the targert table
-* @param $matching_tables_fields array containing the name of the fields for the matching table
+* @param $matching_tables_fields array containing the name of the fields for the matching table
* @param $criteria array containing the criterias
* @param $matching_tables_keys array containing the field names which is key in the source table
* @param $target_tables_keys array containing the field names which is key in the target table
@@ -940,7 +930,7 @@ function PMA_checkForeignKeys($src_db, $src_link, $trg_db, $trg_link ,$reference
* @param $display true/false value
*/
function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$source_columns, &$alter_str_array, $matching_tables_fields, $criteria,
- &$matching_tables_keys, &$target_tables_keys, $matching_table_index, $display)
+ &$matching_tables_keys, &$target_tables_keys, $matching_table_index, $display)
{
$check = true;
$sql_query = '';
@@ -969,22 +959,22 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
}
$pri_query .= ");";
}
-
+
if (isset($pri_query)) {
if ($display == true) {
echo '<p>' . $pri_query . '</p>';
}
- PMA_DBI_try_query($pri_query, $trg_link, 0);
+ PMA_DBI_try_query($pri_query, $trg_link, 0);
}
for ($t = 0; $t < sizeof($matching_tables_fields[$matching_table_index]); $t++) {
if ((isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]])) && (sizeof($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]) > 0)) {
- $sql_query = 'ALTER TABLE ' . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]) . ' MODIFY ' .
- $matching_tables_fields[$matching_table_index][$t] . ' ' . $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'];
+ $sql_query = 'ALTER TABLE ' . PMA_backquote($trg_db) . '.' . PMA_backquote($matching_tables[$matching_table_index]) . ' MODIFY ' .
+ $matching_tables_fields[$matching_table_index][$t] . ' ' . $source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'];
$found = false;
for ($i = 0; $i < sizeof($criteria); $i++)
{
if (isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]]) && $criteria[$i] != 'Key') {
- $found = true;
+ $found = true;
if (($criteria[$i] == 'Type') && (! isset($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i+1]]))) {
if ($source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i + 1]] == 'NO') {
$sql_query .= " Not Null" ;
@@ -1015,7 +1005,7 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
if ($source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'] != 'timestamp') {
$sql_query .= " DEFAULT '" . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]] . "'";
} elseif($source_columns[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]]['Type'] == 'timestamp') {
- $sql_query .= " DEFAULT " . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]];
+ $sql_query .= " DEFAULT " . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]];
}
} elseif (is_numeric($alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]])) {
$sql_query .= " DEFAULT " . $alter_str_array[$matching_table_index][$matching_tables_fields[$matching_table_index][$t]][$criteria[$i]];
@@ -1053,19 +1043,19 @@ function PMA_alterTargetTableStructure($trg_db, $trg_link, $matching_tables, &$s
if ($check) {
if ($display == true) {
echo '<p>' . $query . '</p>';
- }
+ }
PMA_DBI_try_query($query, $trg_link, 0);
}
}
/**
* PMA_removeColumnsFromTargetTable() removes the columns which are present in target table but not in source table.
-*
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing names of matching tables
* @param $uncommon_columns array containing the names of the column which are to be dropped from the target table
-* @param $table_counter index of the matching table as in $matchiing_tables array
+* @param $table_counter index of the matching table as in $matchiing_tables array
* @param $display true/false value
*/
function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables, $uncommon_columns, $table_counter, $display)
@@ -1074,21 +1064,21 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
$drop_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($uncommon_columns[$table_counter]); $a++) {
//Checks if column to be removed is a foreign key in any table
- $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
+ $pk_query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '" . $trg_db . "'
AND REFERENCED_TABLE_NAME = '" . $matching_tables[$table_counter]."' AND REFERENCED_COLUMN_NAME = '"
. $uncommon_columns[$table_counter][$a] . "' AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
-
+
$pk_query_result = PMA_DBI_fetch_result($pk_query, null, null, $trg_link);
$result_size = sizeof($pk_query_result);
-
+
if ($result_size > 0) {
for ($b = 0; $b < $result_size; $b++) {
$drop_pk_query = "ALTER TABLE " . PMA_backquote($pk_query_result[$b]['TABLE_SCHEMA']) . "." . PMA_backquote($pk_query_result[$b]['TABLE_NAME']) . "
DROP FOREIGN KEY " . $pk_query_result[$b]['CONSTRAINT_NAME'] . ", DROP COLUMN " . $pk_query_result[$b]['COLUMN_NAME'] . ";";
- PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
- }
- }
- $query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
+ PMA_DBI_try_query($drop_pk_query, $trg_link, 0);
+ }
+ }
+ $query = "SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . $trg_db . "' AND TABLE_NAME = '"
. $matching_tables[$table_counter]. "' AND COLUMN_NAME = '" . $uncommon_columns[$table_counter][$a] . "'
AND TABLE_NAME <> REFERENCED_TABLE_NAME;";
@@ -1100,41 +1090,40 @@ function PMA_removeColumnsFromTargetTable($trg_db, $trg_link, $matching_tables,
$drop_query .= " DROP COLUMN " . $uncommon_columns[$table_counter][$a];
if ($a < (sizeof($uncommon_columns[$table_counter]) - 1)) {
$drop_query .= " , " ;
- }
+ }
}
$drop_query .= ";" ;
-
+
if ($display == true) {
echo '<p>' . $drop_query . '</p>';
}
- PMA_DBI_try_query($drop_query, $trg_link, 0);
- }
-}
+ PMA_DBI_try_query($drop_query, $trg_link, 0);
+ }
+}
+
/**
-* PMA_indexesDiffInTables() compares the source table indexes with target table indexes and keep the indexes to be added in target table in $add_indexes_array
-* indexes to be altered in $alter_indexes_array and indexes to be removed from target table in $remove_indexes_array.
-* Only keyname and uniqueness characteristic of the indexes are altered.
-* @uses sizeof()
-* @uses PMA_get_table_indexes()
-*
-* @param $src_db name of source database
+* PMA_indexesDiffInTables() compares the source table indexes with target table indexes and keep the indexes to be added in target table in $add_indexes_array
+* indexes to be altered in $alter_indexes_array and indexes to be removed from target table in $remove_indexes_array.
+* Only keyname and uniqueness characteristic of the indexes are altered.
+*
+* @param $src_db name of source database
* @param $trg_db name of target database
* @param $src_link connection established with source server
* @param $trg_link connection established with target server
* @param $matching_tables array containing the matching tables name
-* @param $source_indexes array containing the indexes of the source table
+* @param $source_indexes array containing the indexes of the source table
* @param $target_indexes array containing the indexes of the target table
* @param $add_indexes_array array containing the name of the column on which the index is to be added in the target table
* @param $alter_indexes_array array containing the key name which needs to be altered
* @param $remove_indexes_array array containing the key name of the index which is to be removed from the target table
-* @param $table_counter number of the matching table
+* @param $table_counter number of the matching table
*/
function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matching_tables, &$source_indexes, &$target_indexes, &$add_indexes_array,
&$alter_indexes_array, &$remove_indexes_array, $table_counter)
{
//Gets indexes information for source and target table
$source_indexes[$table_counter] = PMA_get_table_indexes($src_db, $matching_tables[$table_counter],$src_link);
- $target_indexes[$table_counter] = PMA_get_table_indexes($trg_db, $matching_tables[$table_counter],$trg_link);
+ $target_indexes[$table_counter] = PMA_get_table_indexes($trg_db, $matching_tables[$table_counter],$trg_link);
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
$found = false;
$z = 0;
@@ -1152,15 +1141,15 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
}
}
}
- $z++;
+ $z++;
}
if ($found === false) {
if(! ($source_indexes[$table_counter][$a]['Key_name'] == 'PRIMARY')) {
- $add_indexes_array [$table_counter][] = $source_indexes[$table_counter][$a]['Column_name'];
+ $add_indexes_array [$table_counter][] = $source_indexes[$table_counter][$a]['Column_name'];
}
}
}
-
+
//Finds indexes that exist on target table but not on source table
for ($b = 0; $b < sizeof($target_indexes[$table_counter]); $b++) {
$found = false;
@@ -1170,29 +1159,29 @@ function PMA_indexesDiffInTables($src_db, $trg_db, $src_link, $trg_link, $matchi
if ($target_indexes[$table_counter][$b]['Column_name'] == $source_indexes[$table_counter][$c]['Column_name']) {
$found = true;
}
- $c++;
+ $c++;
}
if ($found === false) {
- $remove_indexes_array[$table_counter][] = $target_indexes[$table_counter][$b]['Key_name'];
+ $remove_indexes_array[$table_counter][] = $target_indexes[$table_counter][$b]['Key_name'];
}
}
}
/**
-* PMA_applyIndexesDiff() create indexes, alters indexes and remove indexes.
-*
+* PMA_applyIndexesDiff() create indexes, alters indexes and remove indexes.
+*
* @param $trg_db name of target database
* @param $trg_link connection established with target server
* @param $matching_tables array containing the matching tables name
-* @param $source_indexes array containing the indexes of the source table
+* @param $source_indexes array containing the indexes of the source table
* @param $target_indexes array containing the indexes of the target table
* @param $add_indexes_array array containing the column names on which indexes are to be created in target table
* @param $alter_indexes_array array containing the column names for which indexes are to be altered
* @param $remove_indexes_array array containing the key name of the indexes which are to be removed from the target table
-* @param $table_counter number of the matching table
+* @param $table_counter number of the matching table
* @param $display true/false value
*/
-function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
+function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_indexes, $target_indexes, $add_indexes_array, $alter_indexes_array,
$remove_indexes_array, $table_counter, $display)
{
//Adds indexes on target table
@@ -1200,7 +1189,7 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$sql = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]) . " ADD" ;
for ($a = 0; $a < sizeof($source_indexes[$table_counter]); $a++) {
if (isset($add_indexes_array[$table_counter][$a])) {
- for ($b = 0; $b < sizeof($source_indexes[$table_counter]); $b++) {
+ for ($b = 0; $b < sizeof($source_indexes[$table_counter]); $b++) {
if ($source_indexes[$table_counter][$b]['Column_name'] == $add_indexes_array[$table_counter][$a]) {
if ($source_indexes[$table_counter][$b]['Non_unique'] == '0') {
$sql .= " UNIQUE ";
@@ -1221,9 +1210,9 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($alter_indexes_array[$table_counter]); $a++) {
if (isset($alter_indexes_array[$table_counter][$a])) {
- $query .= ' DROP INDEX ' . PMA_backquote($alter_indexes_array[$table_counter][$a]) . " , ADD ";
+ $query .= ' DROP INDEX ' . PMA_backquote($alter_indexes_array[$table_counter][$a]) . " , ADD ";
$got_first_index_column = false;
- for ($z = 0; $z < sizeof($source_indexes[$table_counter]); $z++) {
+ for ($z = 0; $z < sizeof($source_indexes[$table_counter]); $z++) {
if ($source_indexes[$table_counter][$z]['Key_name'] == $alter_indexes_array[$table_counter][$a]) {
if (! $got_first_index_column) {
if ($source_indexes[$table_counter][$z]['Non_unique'] == '0') {
@@ -1250,25 +1239,25 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind
$drop_index_query = "ALTER TABLE " . PMA_backquote($trg_db) . "." . PMA_backquote($matching_tables[$table_counter]);
for ($a = 0; $a < sizeof($target_indexes[$table_counter]); $a++) {
if (isset($remove_indexes_array[$table_counter][$a])) {
- $drop_index_query .= " DROP INDEX " . $remove_indexes_array[$table_counter][$a];
+ $drop_index_query .= " DROP INDEX " . $remove_indexes_array[$table_counter][$a];
}
if ($a < (sizeof($remove_indexes_array[$table_counter]) - 1)) {
$drop_index_query .= " , " ;
}
}
- $drop_index_query .= " ; " ;
+ $drop_index_query .= " ; " ;
if ($display == true) {
echo '<p>' . $drop_index_query . '</p>';
}
- PMA_DBI_try_query($drop_index_query, $trg_link, 0);
+ PMA_DBI_try_query($drop_index_query, $trg_link, 0);
}
}
/**
* PMA_displayQuery() displays a query, taking the maximum display size
- * into account
- *
- * @param $query the query to display
+ * into account
+ *
+ * @param $query the query to display
*/
function PMA_displayQuery($query) {
if (strlen($query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
@@ -1278,12 +1267,12 @@ function PMA_displayQuery($query) {
}
/**
- * PMA_syncDisplayHeaderSource() shows the header for source database
+ * PMA_syncDisplayHeaderSource() shows the header for source database
*
- * @param string $src_db source db name
+ * @param string $src_db source db name
*/
function PMA_syncDisplayHeaderSource($src_db) {
- echo '<div id="serverstatus" style = "overflow: auto; width: 1020px; height: 220px; border-left: 1px gray solid; border-bottom: 1px gray solid; padding:0px; margin-bottom: 1em "> ';
+ echo '<div id="serverstatus" style = "overflow: auto; width: 1020px; height: 220px; border-left: 1px gray solid; border-bottom: 1px gray solid; padding:0; margin-bottom: 1em "> ';
echo '<table id="serverstatusconnections" class="data" width="55%">';
echo '<tr>';
@@ -1300,10 +1289,10 @@ function PMA_syncDisplayHeaderSource($src_db) {
/**
* PMA_syncDisplayHeaderTargetAndMatchingTables() shows the header for target database and the matching tables
- *
- * @param string $trg_db target db name
+ *
+ * @param string $trg_db target db name
* @param array $matching_tables
- * @return boolean $odd_row current value of this toggle
+ * @return boolean $odd_row current value of this toggle
*/
function PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables) {
echo '<table id="serverstatusconnections" class="data" width="43%">';
@@ -1326,10 +1315,10 @@ function PMA_syncDisplayHeaderTargetAndMatchingTables($trg_db, $matching_tables)
}
/**
- * PMA_syncDisplayBeginTableRow() displays the TR tag for alternating colors
- *
- * @param boolean $odd_row current status of the toggle
- * @return boolean $odd_row final status of the toggle
+ * PMA_syncDisplayBeginTableRow() displays the TR tag for alternating colors
+ *
+ * @param boolean $odd_row current status of the toggle
+ * @return boolean $odd_row final status of the toggle
*/
function PMA_syncDisplayBeginTableRow($odd_row) {
$odd_row = ! $odd_row;
@@ -1348,7 +1337,6 @@ function PMA_syncDisplayBeginTableRow($odd_row) {
* @param mixed $link mysql link resource
* @return array $field_values
*/
-
function PMA_get_column_values($database, $table, $column, $link = null)
{
$query = 'SELECT ';
@@ -1377,7 +1365,6 @@ function PMA_get_column_values($database, $table, $column, $link = null)
* @param mixed $link mysql link resource
* @return array $indexes
*/
-
function PMA_get_table_indexes($database, $table, $link = null)
{
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin website branch, master, updated. b5731f4ca159230c34db6ce111617ca27b1b2867
by Marc Delisle 03 Jul '11
by Marc Delisle 03 Jul '11
03 Jul '11
The branch, master has been updated
via b5731f4ca159230c34db6ce111617ca27b1b2867 (commit)
from 70b2a9718589eb4b040a5ac67de91fceff4930e8 (commit)
- Log -----------------------------------------------------------------
commit b5731f4ca159230c34db6ce111617ca27b1b2867
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sun Jul 3 07:02:15 2011 -0400
This syntax confuses render.py
-----------------------------------------------------------------------
Summary of changes:
templates/security/PMASA-2011-6 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/templates/security/PMASA-2011-6 b/templates/security/PMASA-2011-6
index 2a258e5..c06ba98 100644
--- a/templates/security/PMASA-2011-6
+++ b/templates/security/PMASA-2011-6
@@ -16,7 +16,7 @@ Possible code injection in setup script in case session variables are compromise
<py:def function="announcement_description">
An unsanitized key from the Servers array is written in a comment of the generated config.
-An attacker can modify this key by modifying the $_SESSION array.
+An attacker can modify this key by modifying the SESSION superglobal array.
This allows the attacker to close the comment and inject code.
</py:def>
hooks/post-receive
--
phpMyAdmin website
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-6507-g5560ad5
by Marc Delisle 03 Jul '11
by Marc Delisle 03 Jul '11
03 Jul '11
The branch, master has been updated
via 5560ad53e07d56e6686964de288d487df02a6153 (commit)
via 56883ec0c593cd96e47a3e7bf46ec4e293e3a93f (commit)
via 311804dd728a13e4cd5ce13f303f7b690e7b1aa8 (commit)
via 05519a2bcaf8afea90c2405b9cb9257f24ce41ba (commit)
via 232b2a72c69f0f0baf74b2c26a4f446cf0ae707d (commit)
via 71bb5415d8317764b10ec2424f2cc1bccb5f86d2 (commit)
via d33590a544319dfcd395a94210a378c44a8f3e52 (commit)
via 0cb77d14bad36196664f953d62e247193e1eb30d (commit)
via 2c57318f1b61448cc55fb282efa30a88c9b9f5aa (commit)
via f48271b74b2d475bb158aa05322ce1ac59d303de (commit)
via 3345899ca2c0b537740f0480d7adbf9fbadee47d (commit)
via 0c87f7c6b6c478757aa4d7b96fa85ccf1428937a (commit)
via bc049c6311f3c8e9357b1b7252754a7673ddaa29 (commit)
via 6104ef1ba478e68476963c41b4951baa1a7fc9c7 (commit)
via 045499bd7533da31f262c5e5de739e31d9f08985 (commit)
from 12fcc270f2d0cc7df3a94a131e2f234b0ee8414c (commit)
- Log -----------------------------------------------------------------
commit 5560ad53e07d56e6686964de288d487df02a6153
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sun Jul 3 06:24:29 2011 -0400
ChangeLog entries for new features
commit 56883ec0c593cd96e47a3e7bf46ec4e293e3a93f
Merge: 311804dd728a13e4cd5ce13f303f7b690e7b1aa8 12fcc270f2d0cc7df3a94a131e2f234b0ee8414c
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sun Jul 3 10:52:56 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 311804dd728a13e4cd5ce13f303f7b690e7b1aa8
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sun Jul 3 10:52:16 2011 +0530
Removed the modification for the multi row Export in Table Browse
commit 05519a2bcaf8afea90c2405b9cb9257f24ce41ba
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Jul 2 21:17:37 2011 +0530
Changed the link name in show hide indexes
commit 232b2a72c69f0f0baf74b2c26a4f446cf0ae707d
Merge: 71bb5415d8317764b10ec2424f2cc1bccb5f86d2 a45a11f4e84c19dfa9e4ce0c2e25fc0e9dd8c01f
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Jul 2 15:19:45 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 71bb5415d8317764b10ec2424f2cc1bccb5f86d2
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Jul 2 15:16:00 2011 +0530
Added show hide option for index table in table structure
commit d33590a544319dfcd395a94210a378c44a8f3e52
Merge: 0cb77d14bad36196664f953d62e247193e1eb30d 9fde1b5b23c00a1c9be499122f5d46d4d9b257f3
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Fri Jul 1 23:50:58 2011 +0530
Resolved conflicts
commit 0cb77d14bad36196664f953d62e247193e1eb30d
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Fri Jul 1 23:39:23 2011 +0530
Ajaxify Index edit in table structure
commit 2c57318f1b61448cc55fb282efa30a88c9b9f5aa
Merge: f48271b74b2d475bb158aa05322ce1ac59d303de 3c55511e5c81d479575f9527a0e5b2267440c872
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sun Jun 26 23:30:26 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit f48271b74b2d475bb158aa05322ce1ac59d303de
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sun Jun 26 23:28:34 2011 +0530
Fixed bugs in show error message ine multi row change in table structure
commit 3345899ca2c0b537740f0480d7adbf9fbadee47d
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Jun 25 21:26:56 2011 +0530
Fixed bugs in multi column change in table structure
commit 0c87f7c6b6c478757aa4d7b96fa85ccf1428937a
Merge: bc049c6311f3c8e9357b1b7252754a7673ddaa29 5403fc13ced5e245632ba1b4f237ff5f1a52785f
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Jun 25 16:58:39 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit bc049c6311f3c8e9357b1b7252754a7673ddaa29
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Sat Jun 25 16:57:54 2011 +0530
Ajaxified the multi column change in table structure
commit 6104ef1ba478e68476963c41b4951baa1a7fc9c7
Merge: 045499bd7533da31f262c5e5de739e31d9f08985 0a6f2823bd46fc3f486c0b1ef557c1e1284626ba
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Fri Jun 24 14:57:34 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 045499bd7533da31f262c5e5de739e31d9f08985
Author: Thilanka Kaushalya <lgtkaushalya(a)gmail.com>
Date: Fri Jun 24 14:54:46 2011 +0530
Ajaxify the multi row export in table
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +-
js/messages.php | 2 +
js/sql.js | 10 ++--
js/tbl_structure.js | 142 +++++++++++++++++++++++++++++++++++++++++++++
libraries/Index.class.php | 10 ++-
tbl_indexes.php | 12 +++-
tbl_structure.php | 5 +-
7 files changed, 171 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ae70fb7..bd8ab2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,7 +25,9 @@ phpMyAdmin - ChangeLog
+ [display] More options for browsing GIS data
+ [interface] Support for spatial indexes
+ [display] GIS data visualization
-+ AJAX for table structure multiple-columns change
++ AJAX for table structure multiple-column change
++ AJAX for table structure index edit
++ Show/hide indexes in table structure
3.4.4.0 (not yet released)
- bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
diff --git a/js/messages.php b/js/messages.php
index 7851a19..b8ac2ba 100644
--- a/js/messages.php
+++ b/js/messages.php
@@ -110,6 +110,8 @@ $js_messages['strNo'] = __('No');
/* For db_stucture.js */
$js_messages['strInsertTable'] = __('Insert Table');
+$js_messages['strHideIndexes'] = __('Hide indexes');
+$js_messages['strShowIndexes'] = __('Show indexes');
/* For db_search.js */
$js_messages['strSearching'] = __('Searching');
diff --git a/js/sql.js b/js/sql.js
index 14f4c05..48fb65f 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -1163,7 +1163,7 @@ $(document).ready(function() {
}) // end $.post()
}) // end insert table button "Go"
-/**
+/**$("#buttonYes.ajax").live('click'
* Click action for #buttonYes button in ajax dialog insertForm
*/
$("#buttonYes.ajax").live('click', function(event){
@@ -1370,22 +1370,22 @@ $(document).ready(function() {
$("#sqlqueryresults").trigger('makegrid');
});
-/*
+/*
* Profiling Chart
*/
function createProfilingChart() {
if($('#profilingchart').length==0) return;
-
+
var cdata = new Array();
$.each(jQuery.parseJSON($('#profilingchart').html()),function(key,value) {
cdata.push([key,parseFloat(value)]);
});
-
+
// Prevent the user from seeing the JSON code
$('div#profilingchart').html('').show();
PMA_createChart({
- chart: {
+ chart: {
renderTo: 'profilingchart',
backgroundColor: $('#sqlqueryresults fieldset').css('background-color')
},
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index d1a2676..d4ef1cd 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -250,4 +250,146 @@ $(document).ready(function() {
}) // end $.post()
}) // end insert table button "do_save_data"
+ /**
+ *Ajax event handler for index edit
+ **/
+ $("#table_index tbody tr td.edit_index.ajax").live('click', function(event){
+ event.preventDefault();
+ var url = $(this).find("a").attr("href");
+ if (url.substring(0, 16) == "tbl_indexes.php?") {
+ url = url.substring(16, url.length );
+ }
+ url = url + "&ajax_request=true";
+
+ var div = $('<div id="edit_index_dialog"></div>');
+
+ /**
+ * @var button_options Object that stores the options passed to jQueryUI
+ * dialog
+ */
+ var button_options = {};
+ // in the following function we need to use $(this)
+ button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();}
+
+ var button_options_error = {};
+ button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();}
+ var $msgbox = PMA_ajaxShowMessage();
+
+ $.get( "tbl_indexes.php" , url , function(data) {
+ //in the case of an error, show the error message returned.
+ if (data.success != undefined && data.success == false) {
+ div
+ .append(data.error)
+ .dialog({
+ title: PMA_messages['strEdit'],
+ height: 230,
+ width: 900,
+ open: PMA_verifyTypeOfAllColumns,
+ buttons : button_options_error
+ })// end dialog options
+ } else {
+ div
+ .append(data)
+ .dialog({
+ title: PMA_messages['strEdit'],
+ height: 600,
+ width: 900,
+ open: PMA_verifyTypeOfAllColumns,
+ buttons : button_options
+ })
+ //Remove the top menu container from the dialog
+ .find("#topmenucontainer").hide()
+ ; // end dialog options
+ }
+ PMA_ajaxRemoveMessage($msgbox);
+ }) // end $.get()
+ });
+
+ /**
+ *Ajax action for submiting the index form
+ **/
+ $("#index_frm.ajax input[name=do_save_data]").live('click', function(event) {
+ event.preventDefault();
+ /**
+ * @var the_form object referring to the export form
+ */
+ var $form = $("#index_frm");
+
+ PMA_prepareForAjaxRequest($form);
+ //User wants to submit the form
+ $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) {
+ if ($("#sqlqueryresults").length != 0) {
+ $("#sqlqueryresults").remove();
+ }
+ if (data.success == true) {
+ PMA_ajaxShowMessage(data.message);
+ $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
+ $("#sqlqueryresults").html(data.sql_query);
+ $("#result_query .notice").remove();
+ $("#result_query").prepend((data.message));
+
+ /*Reload the field form*/
+ $("#table_index").remove();
+ var temp_div = $("<div id='temp_div'><div>").append(data.index_table);
+ $(temp_div).find("#table_index").insertAfter("#index_header");
+ if ($("#edit_index_dialog").length > 0) {
+ $("#edit_index_dialog").dialog("close").remove();
+ }
+
+ } else {
+ var temp_div = $("<div id='temp_div'><div>").append(data.error);
+ var error = $(temp_div).find(".error code").addClass("error");
+ PMA_ajaxShowMessage(error);
+ }
+
+ }) // end $.post()
+ }) // end insert table button "do_save_data"
+
+ /**
+ *Ajax action for submiting the index form for add more columns
+ **/
+ $("#index_frm.ajax input[name=add_fields]").live('click', function(event) {
+ event.preventDefault();
+ /**
+ * @var the_form object referring to the export form
+ */
+ var $form = $("#index_frm");
+
+ PMA_prepareForAjaxRequest($form);
+ //User wants to submit the form
+ $.post($form.attr('action'), $form.serialize()+"&add_fields=Go", function(data) {
+ $("#index_columns").remove();
+ var temp_div = $("<div id='temp_div'><div>").append(data);
+ $(temp_div).find("#index_columns").insertAfter("#index_frm fieldset .error");
+ }) // end $.post()
+ }) // end insert table button "Go"
+
+ /**Add the show/hide index table option if the index is available*/
+ if ($("#index_div.ajax").find("#table_index").length != 0) {
+ /**
+ *Prepare a div containing a link for toggle the index table
+ */
+ $('<div id="toggletableindexdiv"><a id="toggletableindexlink"></a></div>')
+ .insertAfter('#index_div')
+ /** don't show it until we have index table on-screen */
+ .show();
+
+ /** Changing the displayed text according to the hide/show criteria in table index*/
+
+ $('#toggletableindexlink')
+ .html(PMA_messages['strHideIndexes'])
+ .bind('click', function() {
+ var $link = $(this);
+ $('#index_div').slideToggle();
+ if ($link.text() == PMA_messages['strHideIndexes']) {
+ $link.text(PMA_messages['strShowIndexes']);
+ } else {
+ $link.text(PMA_messages['strHideIndexes']);
+ }
+ /** avoid default click action */
+ return false;
+ });
+ } //end show/hide table index
+
+
}) // end $(document).ready()
diff --git a/libraries/Index.class.php b/libraries/Index.class.php
index 9992e1c..1800aee 100644
--- a/libraries/Index.class.php
+++ b/libraries/Index.class.php
@@ -419,10 +419,10 @@ class PMA_Index
$r = '';
- $r .= '<h2>' . __('Indexes') . ': ';
+ $r .= '<h2 id="index_header">' . __('Indexes') . ': ';
$r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure');
$r .= '</h2>';
- $r .= '<table>';
+ $r .= '<table id="table_index">';
$r .= '<thead>';
$r .= '<tr>';
if (! $print_mode) {
@@ -450,7 +450,11 @@ class PMA_Index
if (! $print_mode) {
$this_params = $GLOBALS['url_params'];
$this_params['index'] = $index->getName();
- $r .= '<td ' . $row_span . '>'
+ $r .= '<td class="edit_index ';
+ if ($GLOBALS['cfg']['AjaxEnable']) {
+ $r .= 'ajax" ';
+ }
+ $r .= '" ' . $row_span . '>'
. ' <a href="tbl_indexes.php' . PMA_generate_common_url($this_params)
. '">' . PMA_getIcon('b_edit.png', __('Edit')) . '</a>'
. '</td>' . "\n";
diff --git a/tbl_indexes.php b/tbl_indexes.php
index e366047..995ee24 100644
--- a/tbl_indexes.php
+++ b/tbl_indexes.php
@@ -97,7 +97,13 @@ if (isset($_REQUEST['do_save_data'])) {
PMA_DBI_query($sql_query);
$message = PMA_Message::success(__('Table %1$s has been altered successfully'));
$message->addParam($table);
-
+
+ if( $GLOBALS['is_ajax_request'] == true) {
+ $extra_data['index_table'] = PMA_Index::getView($table, $db);
+ $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
+ PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
+ }
+
$active_page = 'tbl_structure.php';
require './tbl_structure.php';
exit;
@@ -133,7 +139,7 @@ if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) {
// end preparing form values
?>
-<form action="./tbl_indexes.php" method="post" name="index_frm"
+<form action="./tbl_indexes.php" method="post" name="index_frm" id="index_frm" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : ''); ?>
onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') {
this.elements['index'].disabled = false}">
<?php
@@ -183,7 +189,7 @@ if (isset($_REQUEST['create_index'])) {
PMA_Message::error(__('("PRIMARY" <b>must</b> be the name of and <b>only of</b> a primary key!)'))->display();
?>
-<table>
+<table id="index_columns">
<thead>
<tr><th><?php echo __('Column'); ?></th>
<th><?php echo __('Size'); ?></th>
diff --git a/tbl_structure.php b/tbl_structure.php
index 081b4b5..10cc8d3 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -14,7 +14,7 @@ require_once './libraries/mysql_charsets.lib.php';
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
$GLOBALS['js_include'][] = 'tbl_structure.js';
-
+$GLOBALS['js_include'][] = 'indexes.js';
/**
* handle multiple field commands if required
*
@@ -699,6 +699,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
</form>
<iframe class="IE_hack" scrolling="no"></iframe>
<hr />
+<div id="index_div" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : ''); ?> >
<?php
}
@@ -720,7 +721,7 @@ if (! $tbl_is_view && ! $db_is_information_schema && 'ARCHIVE' != $tbl_type) {
*/
echo PMA_Index::getView($table, $db);
?>
-<br />
+</div>
<form action="./tbl_indexes.php" method="post"
onsubmit="return checkFormElementInRange(this, 'idx_num_fields',
'<?php echo str_replace('\'', '\\\'', __('Column count has to be larger than zero.')); ?>',
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin website branch, master, updated. 70b2a9718589eb4b040a5ac67de91fceff4930e8
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The branch, master has been updated
via 70b2a9718589eb4b040a5ac67de91fceff4930e8 (commit)
via b485ad1a022e5128e8f37c0384fbfb12b4553439 (commit)
via 4fc90d8c6a9af036c8bb564faa15be1cae661284 (commit)
via 950c4c98010ad59331351dfb4659fc106be2b62d (commit)
via b9affc5b9701f68d168b0ee7feafb1cc67ccbee5 (commit)
via c53a6a1d961f3819f0d1fc9890496a7986a482b4 (commit)
via 924e97227865eb5e6666238096b675e986d9d4c5 (commit)
via 7da34555f1d66de6b6e7d018b364fd6bc59eb5fc (commit)
via 873a3c8bcca541b79e33f825791658f7ead7651f (commit)
via 6b8c417c12222232369120ddd757324d51c3fb27 (commit)
via f6b86afaec1d5c8ad7483451a45b89cdbf34ad4e (commit)
via e8642202b392f4ac20c5f8b2108d8046b42cad15 (commit)
via 5c69648b526ff22826018c4de8bb587d4159d663 (commit)
via 9ec98517f2b7c602f605c3c9a2ce3f7b2979fbb6 (commit)
from 1e1ed41354c775cbe25e3b708c549c78e4bf3b95 (commit)
- Log -----------------------------------------------------------------
commit 70b2a9718589eb4b040a5ac67de91fceff4930e8
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Jul 2 21:47:39 2011 -0400
Announcements date
commit b485ad1a022e5128e8f37c0384fbfb12b4553439
Merge: 1e1ed41354c775cbe25e3b708c549c78e4bf3b95 4fc90d8c6a9af036c8bb564faa15be1cae661284
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Jul 2 21:43:16 2011 -0400
Merge remote branch 'security/website-security'
commit 4fc90d8c6a9af036c8bb564faa15be1cae661284
Author: Herman van Rink <rink(a)initfour.nl>
Date: Sat Jul 2 23:23:49 2011 +0200
Lowered PMASA-2011-6 to non critical
commit 950c4c98010ad59331351dfb4659fc106be2b62d
Author: Herman van Rink <rink(a)initfour.nl>
Date: Sat Jul 2 23:13:40 2011 +0200
Raised to critical
commit b9affc5b9701f68d168b0ee7feafb1cc67ccbee5
Author: Herman van Rink <rink(a)initfour.nl>
Date: Sat Jul 2 23:13:20 2011 +0200
Added some CWE
commit c53a6a1d961f3819f0d1fc9890496a7986a482b4
Author: Herman van Rink <rink(a)initfour.nl>
Date: Sat Jul 2 22:56:38 2011 +0200
Split commit hashes for 3.3 into separate section with announcement_commits_3_3
commit 924e97227865eb5e6666238096b675e986d9d4c5
Author: Herman van Rink <rink(a)initfour.nl>
Date: Sat Jul 2 22:52:21 2011 +0200
Added Frans Pehrson (Xxor AB) to announcement_references
commit 7da34555f1d66de6b6e7d018b364fd6bc59eb5fc
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jun 30 17:00:07 2011 -0400
MIME should be spelt in caps
commit 873a3c8bcca541b79e33f825791658f7ead7651f
Author: Herman van Rink <rink(a)initfour.nl>
Date: Thu Jun 30 22:32:56 2011 +0200
Added PMASA-2011-8
commit 6b8c417c12222232369120ddd757324d51c3fb27
Author: Herman van Rink <rink(a)initfour.nl>
Date: Thu Jun 30 22:32:31 2011 +0200
typo fixes
commit f6b86afaec1d5c8ad7483451a45b89cdbf34ad4e
Author: Herman van Rink <rink(a)initfour.nl>
Date: Thu Jun 30 22:38:08 2011 +0200
Added trailing period to announcement_summary fields
commit e8642202b392f4ac20c5f8b2108d8046b42cad15
Author: Marc Delisle <marc(a)infomarc.info>
Date: Thu Jun 30 15:16:22 2011 -0400
Typos fixed, clarifications added
commit 5c69648b526ff22826018c4de8bb587d4159d663
Author: Herman van Rink <rink(a)initfour.nl>
Date: Thu Jun 30 15:18:57 2011 +0200
Added PMASA-2011-6 and PMASA-2011-7 draft
commit 9ec98517f2b7c602f605c3c9a2ce3f7b2979fbb6
Author: Herman van Rink <rink(a)initfour.nl>
Date: Thu Jun 30 12:48:32 2011 +0200
PMASA-2011-5 draft
-----------------------------------------------------------------------
Summary of changes:
templates/security/{PMASA-2011-2 => PMASA-2011-5} | 33 ++++++------
templates/security/PMASA-2011-6 | 58 +++++++++++++++++++++
templates/security/{_PMASA_ => PMASA-2011-7} | 45 +++++-----------
templates/security/{PMASA-2011-4 => PMASA-2011-8} | 26 +++++----
4 files changed, 102 insertions(+), 60 deletions(-)
copy templates/security/{PMASA-2011-2 => PMASA-2011-5} (51%)
create mode 100644 templates/security/PMASA-2011-6
copy templates/security/{_PMASA_ => PMASA-2011-7} (50%)
copy templates/security/{PMASA-2011-4 => PMASA-2011-8} (57%)
diff --git a/templates/security/PMASA-2011-2 b/templates/security/PMASA-2011-5
similarity index 51%
copy from templates/security/PMASA-2011-2
copy to templates/security/PMASA-2011-5
index 8dfca27..0661593 100644
--- a/templates/security/PMASA-2011-2
+++ b/templates/security/PMASA-2011-5
@@ -3,55 +3,54 @@
<py:def function="announcement_id">
-PMASA-2011-2
+PMASA-2011-5
</py:def>
<py:def function="announcement_date">
-2011-02-11
+2011-07-02
</py:def>
<py:def function="announcement_summary">
-SQL query could be executed under another user.
+Possible session manipulation in Swekey authentication.
</py:def>
<py:def function="announcement_description">
-It was possible to create a bookmark which would be executed unintentionally by other users.
+It was possible to manipulate the PHP session superglobal using some of the Swekey authentication code.
+This could open a path for other attacks.
</py:def>
<py:def function="announcement_severity">
We consider this vulnerability to be critical.
</py:def>
-<py:def function="announcement_mitigation">
-To use this vulnerability, phpMyAdmin configuration storage needs to be
-set up and enabled and bookmarks function needs to be enabled.
+<py:def function="announcement_affected">
+The 3.4.3 and earlier versions are affected.
</py:def>
-<py:def function="announcement_affected">
-The 2.11.x and 3.3.x versions are affected.
+<py:def function="announcement_unaffected">
+Branch 2.11.x is not affected by this.
</py:def>
<py:def function="announcement_solution">
-Upgrade to phpMyAdmin 3.3.9.2 or newer (2.11.11.3 or newer for the older
-family) or apply the related patch listed below.
+Upgrade to phpMyAdmin 3.3.10.2 or 3.4.3.1 or apply the related patch listed below.
</py:def>
<!--! Links to reporter etc, do not forget to escape & to & -->
<py:def function="announcement_references">
-This issue was found by <a href="http://cihar.com/">Michal Čihař</a>.
+This issue was found by Frans Pehrson from <a href="http://www.xxor.se">Xxor AB</a>
</py:def>
<!--! CVE ID of the report, this is automatically added to references -->
-<py:def function="announcement_cve">CVE-2011-0987</py:def>
+<py:def function="announcement_cve">CVE-2011-2505</py:def>
-<py:def function="announcement_cwe">661 89</py:def>
+<py:def function="announcement_cwe">661</py:def>
<py:def function="announcement_commits">
-a5464b4daff0059cdf8c9e5f4d54a80e2dd2a5b0
+7ebd958b2bf59f96fecd5b3322bdbd0b244a7967
</py:def>
-<py:def function="announcement_commits_2_11">
-2fa4c8d97a92ae0d4e2051d5d18a18688c31f84f
+<py:def function="announcement_commits_3_3">
+6e6e129f26295c83d67b74e202628a4b8bc49e54
</py:def>
<xi:include href="_page.tpl" />
diff --git a/templates/security/PMASA-2011-6 b/templates/security/PMASA-2011-6
new file mode 100644
index 0000000..2a258e5
--- /dev/null
+++ b/templates/security/PMASA-2011-6
@@ -0,0 +1,58 @@
+<!--! Template for security announcement -->
+<html xmlns:py="http://genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
+
+
+<py:def function="announcement_id">
+PMASA-2011-6
+</py:def>
+
+<py:def function="announcement_date">
+2011-07-02
+</py:def>
+
+<py:def function="announcement_summary">
+Possible code injection in setup script in case session variables are compromised.
+</py:def>
+
+<py:def function="announcement_description">
+An unsanitized key from the Servers array is written in a comment of the generated config.
+An attacker can modify this key by modifying the $_SESSION array.
+This allows the attacker to close the comment and inject code.
+</py:def>
+
+<py:def function="announcement_severity">
+We consider this vulnerability to be non critical.
+</py:def>
+
+<py:def function="announcement_affected">
+The 3.4.3 and earlier versions are affected.
+</py:def>
+
+<py:def function="announcement_unaffected">
+Branch 2.11.x is not affected by this.
+</py:def>
+
+<py:def function="announcement_solution">
+Upgrade to phpMyAdmin 3.3.10.2 or 3.4.3.1 or apply the related patch listed below.
+</py:def>
+
+<!--! Links to reporter etc, do not forget to escape & to & -->
+<py:def function="announcement_references">
+This issue was found by Frans Pehrson from <a href="http://www.xxor.se">Xxor AB</a>
+</py:def>
+
+<!--! CVE ID of the report, this is automatically added to references -->
+<py:def function="announcement_cve">CVE-2011-2506</py:def>
+
+<py:def function="announcement_cwe">661 116</py:def>
+
+<py:def function="announcement_commits">
+0fbedaf5fd7a771d0885c6b7385d934fc90d0d7f
+</py:def>
+
+<py:def function="announcement_commits_3_3">
+2e01647949df937040e73a94ce0bac0daecbdcf4
+</py:def>
+
+<xi:include href="_page.tpl" />
+</html>
diff --git a/templates/security/_PMASA_ b/templates/security/PMASA-2011-7
similarity index 50%
copy from templates/security/_PMASA_
copy to templates/security/PMASA-2011-7
index 42f4f53..6a1aeb6 100644
--- a/templates/security/_PMASA_
+++ b/templates/security/PMASA-2011-7
@@ -3,75 +3,58 @@
<py:def function="announcement_id">
-PMASA-2011-?
+PMASA-2011-7
</py:def>
<py:def function="announcement_date">
-2011-??-??
+2011-07-02
</py:def>
-<!--! Optional section, use only if something has been changed
-<py:def function="announcement_updated">
-2011-??-??
-</py:def>
--->
-
<py:def function="announcement_summary">
+Regular expression quoting issue in Synchronize code.
</py:def>
-
-<!--! If you need to avoid toplevel <p></p>, use this:
-<py:def function="announcement_description_fmt">
--->
<py:def function="announcement_description">
+Through a possible bug in PHP running on Windows systems a null byte can truncate the pattern string allowing an attacker to inject the /e modifier causing the preg_replace function to execute its second argument as PHP code.
</py:def>
<py:def function="announcement_severity">
+We consider this vulnerability to be serious.
</py:def>
-<!--! Optional section
<py:def function="announcement_mitigation">
+Only PHP running on Windows has been found to be vulnerable, Linux and OpenBSD are not affected.
</py:def>
--->
<py:def function="announcement_affected">
+The 3.4.3 and earlier versions are affected.
</py:def>
-<!--! Optional section
<py:def function="announcement_unaffected">
+Branch 2.11.x is not affected by this.
</py:def>
--->
<py:def function="announcement_solution">
-Upgrade to phpMyAdmin ???? or newer or apply patch listed below.
+Upgrade to phpMyAdmin 3.3.10.2 or 3.4.3.1 or apply the related patch listed below.
</py:def>
<!--! Links to reporter etc, do not forget to escape & to & -->
<py:def function="announcement_references">
+This issue was found by Frans Pehrson from <a href="http://www.xxor.se">Xxor AB</a>
</py:def>
<!--! CVE ID of the report, this is automatically added to references -->
-<py:def function="announcement_cve">CVE-201x-xxxx</py:def>
+<py:def function="announcement_cve">CVE-2011-2507</py:def>
-<!--! CWE IDs of the problem, CWE provides categorisation of the problems,
-661 is "Weaknesses in Software Written in PHP"
-See http://nvd.nist.gov/cwe.cfm for more information
--->
<py:def function="announcement_cwe">661</py:def>
-<!--! Links to SVN or tracker, do not forget to escape & to & -->
-<py:def function="announcement_patches">
-</py:def>
-
-<!--! Optional section with list of commits fixing this, one per line
<py:def function="announcement_commits">
+69fb0f8e7dc38075427aceaf09bcac697d0590ff
</py:def>
--->
-<!--! Optional section with list of commits fixing this for 2.11 branch, one per line
-<py:def function="announcement_commits_2_11">
+<py:def function="announcement_commits_3_3">
+ca74f480f119a53ef07ca40d2ab28f063cc89ec9
</py:def>
--->
<xi:include href="_page.tpl" />
</html>
diff --git a/templates/security/PMASA-2011-4 b/templates/security/PMASA-2011-8
similarity index 57%
copy from templates/security/PMASA-2011-4
copy to templates/security/PMASA-2011-8
index 8ea0026..8cd1be6 100644
--- a/templates/security/PMASA-2011-4
+++ b/templates/security/PMASA-2011-8
@@ -3,20 +3,19 @@
<py:def function="announcement_id">
-PMASA-2011-4
+PMASA-2011-8
</py:def>
<py:def function="announcement_date">
-2011-05-22
+2011-07-02
</py:def>
<py:def function="announcement_summary">
-URL redirection to untrusted site.
+Possible directory traversal.
</py:def>
<py:def function="announcement_description">
-It was possible to redirect to an arbitrary, untrusted site, leading to
-a possible phishing attack.
+Fixed filtering of a file path in the MIME-type transformation code, which allowed for directory traversal.
</py:def>
<py:def function="announcement_severity">
@@ -24,26 +23,29 @@ We consider this vulnerability to be serious.
</py:def>
<py:def function="announcement_affected">
-The 3.4.0 version is affected.
+The 3.4.3 and earlier versions are affected.
</py:def>
<py:def function="announcement_solution">
-Upgrade to phpMyAdmin 3.4.1 or apply the related patch listed below.
+Upgrade to phpMyAdmin 3.3.10.2 or 3.4.3.1 or apply the related patch listed below.
</py:def>
<!--! Links to reporter etc, do not forget to escape & to & -->
<py:def function="announcement_references">
-This issue was found by Kian Mohageri.
+This issue was found by Frans Pehrson from <a href="http://www.xxor.se">Xxor AB</a>
</py:def>
<!--! CVE ID of the report, this is automatically added to references -->
-<py:def function="announcement_cve">CVE-2011-1941</py:def>
+<py:def function="announcement_cve">CVE-2011-2508</py:def>
-<py:def function="announcement_cwe">661 601</py:def>
+<py:def function="announcement_cwe">661 98</py:def>
<py:def function="announcement_commits">
-b7a8179eb6bf0f1643970ac57a70b5b513a1cd4f
-ecfc8ba4f7b4ea612c58ab5726054ed0f28e200d
+b434320eff8ca9c2fc1b043c1804f868341af9a7
+</py:def>
+
+<py:def function="announcement_commits_3_3">
+5ee357a572866e730d83f56d6187a67c7c48e523
</py:def>
<xi:include href="_page.tpl" />
hooks/post-receive
--
phpMyAdmin website
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, TESTING, updated. RELEASE_3_4_3_1-39-g50efb55
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The branch, TESTING has been updated
via 50efb55a96643e997120a88e06b1a854b2feebd7 (commit)
via e214683f9fe4955dcbf0ffce045983728c7fa9d3 (commit)
via b434320eff8ca9c2fc1b043c1804f868341af9a7 (commit)
via 69fb0f8e7dc38075427aceaf09bcac697d0590ff (commit)
via 0fbedaf5fd7a771d0885c6b7385d934fc90d0d7f (commit)
via 7ebd958b2bf59f96fecd5b3322bdbd0b244a7967 (commit)
from dfae6aa3ee78806160113cb221ba1249d5b6fdf9 (commit)
- Log -----------------------------------------------------------------
commit 50efb55a96643e997120a88e06b1a854b2feebd7
Merge: dfae6aa3ee78806160113cb221ba1249d5b6fdf9 e214683f9fe4955dcbf0ffce045983728c7fa9d3
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Jul 2 21:19:06 2011 -0400
Merge branch 'MAINT_3_4_3' into TESTING
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 18 ++++++++++++------
Documentation.html | 4 ++--
README | 2 +-
libraries/Config.class.php | 2 +-
libraries/auth/swekey/swekey.auth.lib.php | 5 ++---
libraries/display_tbl.lib.php | 2 +-
libraries/server_synchronize.lib.php | 2 +-
setup/lib/ConfigGenerator.class.php | 2 +-
8 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ee33037..28a5ee0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
phpMyAdmin - ChangeLog
======================
+3.4.3.1 (2011-07-02)
+- [security] Fixed possible session manipulation in swekey authentication, see PMASA-2011-5
+- [security] Fixed possible code injection incase session variables are compromised, see PMASA-2011-6
+- [security] Fixed regexp quoting issue in Synchronize code, see PMASA-2011-7
+- [security] Fixed filtering of a file path, which allowed for directory traversal, see PMASA-2011-8
+
3.4.3.0 (2011-06-27)
- bug #3311170 [sync] Missing helper icons in Synchronize
- patch #3304473 [setup] Redefine a lable that was wrong
@@ -89,7 +95,7 @@ phpMyAdmin - ChangeLog
+ patch #2974341 [structure] Clicking on table name in db Structure should
Browse the table if possible, thanks to bhdouglass - dougboybhd
+ patch #2975533 [search] New search operators, thanks to
- Martynas Mickevičius
+ Martynas MickeviÄius
+ patch #2967320 [designer] Colored relations based on the primary key,
thanks to GreenRover - greenrover
- [core] Provide way for vendors to easily change paths to config files.
@@ -246,7 +252,7 @@ phpMyAdmin - ChangeLog
3.3.7.0 (2010-09-07)
- patch #3050492 [PDF scratchboard] Cannot drag table box to the edge after
- a page size increase, thanks to Martin Schönberger - mad05
+ a page size increase, thanks to Martin Schönberger - mad05
3.3.6.0 (2010-08-28)
- bug #3033063 [core] Navi gets wrong db name
@@ -267,7 +273,7 @@ phpMyAdmin - ChangeLog
3.3.5.0 (2010-07-26)
- patch #2932113 [information_schema] Slow export when having lots of
- databases, thanks to Stéphane Pontier - shadow_walker
+ databases, thanks to Stéphane Pontier - shadow_walker
- bug #3022705 [import] Import button does not work in Catalan when there
is no progress bar possible
- bug [replication] Do not offer information_schema in the list of databases
@@ -307,9 +313,9 @@ phpMyAdmin - ChangeLog
- patch #2984893 [engines] InnoDB storage page emits a warning,
thanks to Madhura Jayaratne - madhuracj
- bug #2974687, bug #2974692 [compatibility] PHPExcel : IBM AIX iconv() does not work,
- thanks to Björn Wiberg - bwiberg
+ thanks to Björn Wiberg - bwiberg
- bug #2983066 [interface] Flush table on table operations shows the query twice,
- thanks to Martynas Mickevičius - BlinK_
+ thanks to Martynas MickeviÄius - BlinK_
- bug #2983060, patch #2987900 [interface] Fix initial state of tables in
designer, thanks to Sutharshan Balachandren.
- bug #2983062, patch #2989408 [engines] Fix warnings when changing table
@@ -388,7 +394,7 @@ phpMyAdmin - ChangeLog
+ rfe #2839504 [engines] Support InnoDB plugin's new row formats
+ [core] Added ability for synchronizing databases among servers.
+ [lang] #2843101 Dutch update, thanks to scavenger2008
-+ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
++ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
+ [export] Added MediaWiki export module,
thanks to Derek Schaefer - drummingds1
+ [lang] Turkish update, thanks to Burak Yavuz
diff --git a/Documentation.html b/Documentation.html
index 576c1f0..25b9731 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>phpMyAdmin 3.4.3 - Documentation</title>
+ <title>phpMyAdmin 3.4.3.1 - Documentation</title>
<link rel="stylesheet" type="text/css" href="docs.css" />
</head>
@@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
<div id="header">
<h1>
<a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a>
- 3.4.3
+ 3.4.3.1
Documentation
</h1>
</div>
diff --git a/README b/README
index 02ad016..e57152a 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================
-Version 3.4.3
+Version 3.4.3.1
A set of PHP-scripts to manage MySQL over the web.
diff --git a/libraries/Config.class.php b/libraries/Config.class.php
index cd1a0bf..28625f2 100644
--- a/libraries/Config.class.php
+++ b/libraries/Config.class.php
@@ -96,7 +96,7 @@ class PMA_Config
*/
function checkSystem()
{
- $this->set('PMA_VERSION', '3.4.3');
+ $this->set('PMA_VERSION', '3.4.3.1');
/**
* @deprecated
*/
diff --git a/libraries/auth/swekey/swekey.auth.lib.php b/libraries/auth/swekey/swekey.auth.lib.php
index d2ec1b1..c5f613b 100644
--- a/libraries/auth/swekey/swekey.auth.lib.php
+++ b/libraries/auth/swekey/swekey.auth.lib.php
@@ -263,11 +263,10 @@ function Swekey_login($input_name, $input_go)
}
}
-if (strstr($_SERVER['QUERY_STRING'],'session_to_unset') != false)
+if (!empty($_GET['session_to_unset']))
{
- parse_str($_SERVER['QUERY_STRING']);
session_write_close();
- session_id($session_to_unset);
+ session_id($_GET['session_to_unset']);
session_start();
$_SESSION = array();
session_write_close();
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 64a0383..c7d74ef 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1308,7 +1308,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
if ($GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) && isset($GLOBALS['mime_map'][$meta->name]['transformation']) && !empty($GLOBALS['mime_map'][$meta->name]['transformation'])) {
- $include_file = $GLOBALS['mime_map'][$meta->name]['transformation'];
+ $include_file = PMA_securePath($GLOBALS['mime_map'][$meta->name]['transformation']);
if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = str_replace('.inc.php', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index ba6f813..c9f1242 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -624,7 +624,7 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
// Replace the src table name with a `dbname`.`tablename`
- $Create_Table_Query = preg_replace('/' . PMA_backquote($uncommon_tables[$table_index]) . '/',
+ $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]),
$Create_Query,
$limit = 1
diff --git a/setup/lib/ConfigGenerator.class.php b/setup/lib/ConfigGenerator.class.php
index 95c3325..e33775e 100644
--- a/setup/lib/ConfigGenerator.class.php
+++ b/setup/lib/ConfigGenerator.class.php
@@ -39,7 +39,7 @@ class ConfigGenerator
if ($cf->getServerCount() > 0) {
$ret .= "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf;
foreach ($c['Servers'] as $id => $server) {
- $ret .= '/* Server: ' . strtr($cf->getServerName($id), '*/', '-') . " [$id] */" . $crlf
+ $ret .= '/* Server: ' . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') . "*/" . $crlf
. '$i++;' . $crlf;
foreach ($server as $k => $v) {
$k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, STABLE, updated. RELEASE_3_4_3_1-22-ge1a95b8
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The branch, STABLE has been updated
via e1a95b8cca8ed2eb89683bb78067079d6a7128e1 (commit)
via e214683f9fe4955dcbf0ffce045983728c7fa9d3 (commit)
via b434320eff8ca9c2fc1b043c1804f868341af9a7 (commit)
via 69fb0f8e7dc38075427aceaf09bcac697d0590ff (commit)
via 0fbedaf5fd7a771d0885c6b7385d934fc90d0d7f (commit)
via 7ebd958b2bf59f96fecd5b3322bdbd0b244a7967 (commit)
from da052729c9c1783836ed0de402939c54fc2a94f8 (commit)
- Log -----------------------------------------------------------------
commit e1a95b8cca8ed2eb89683bb78067079d6a7128e1
Merge: da052729c9c1783836ed0de402939c54fc2a94f8 e214683f9fe4955dcbf0ffce045983728c7fa9d3
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Jul 2 21:19:06 2011 -0400
Merge branch 'MAINT_3_4_3' into STABLE
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 18 ++++++++++++------
Documentation.html | 4 ++--
README | 2 +-
libraries/Config.class.php | 2 +-
libraries/auth/swekey/swekey.auth.lib.php | 5 ++---
libraries/display_tbl.lib.php | 2 +-
libraries/server_synchronize.lib.php | 2 +-
setup/lib/ConfigGenerator.class.php | 2 +-
8 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cb3ba9a..fe71031 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
phpMyAdmin - ChangeLog
======================
+3.4.3.1 (2011-07-02)
+- [security] Fixed possible session manipulation in swekey authentication, see PMASA-2011-5
+- [security] Fixed possible code injection incase session variables are compromised, see PMASA-2011-6
+- [security] Fixed regexp quoting issue in Synchronize code, see PMASA-2011-7
+- [security] Fixed filtering of a file path, which allowed for directory traversal, see PMASA-2011-8
+
3.4.3.0 (2011-06-27)
- bug #3311170 [sync] Missing helper icons in Synchronize
- patch #3304473 [setup] Redefine a lable that was wrong
@@ -89,7 +95,7 @@ phpMyAdmin - ChangeLog
+ patch #2974341 [structure] Clicking on table name in db Structure should
Browse the table if possible, thanks to bhdouglass - dougboybhd
+ patch #2975533 [search] New search operators, thanks to
- Martynas Mickevičius
+ Martynas MickeviÄius
+ patch #2967320 [designer] Colored relations based on the primary key,
thanks to GreenRover - greenrover
- [core] Provide way for vendors to easily change paths to config files.
@@ -243,7 +249,7 @@ phpMyAdmin - ChangeLog
3.3.7.0 (2010-09-07)
- patch #3050492 [PDF scratchboard] Cannot drag table box to the edge after
- a page size increase, thanks to Martin Schönberger - mad05
+ a page size increase, thanks to Martin Schönberger - mad05
3.3.6.0 (2010-08-28)
- bug #3033063 [core] Navi gets wrong db name
@@ -264,7 +270,7 @@ phpMyAdmin - ChangeLog
3.3.5.0 (2010-07-26)
- patch #2932113 [information_schema] Slow export when having lots of
- databases, thanks to Stéphane Pontier - shadow_walker
+ databases, thanks to Stéphane Pontier - shadow_walker
- bug #3022705 [import] Import button does not work in Catalan when there
is no progress bar possible
- bug [replication] Do not offer information_schema in the list of databases
@@ -304,9 +310,9 @@ phpMyAdmin - ChangeLog
- patch #2984893 [engines] InnoDB storage page emits a warning,
thanks to Madhura Jayaratne - madhuracj
- bug #2974687, bug #2974692 [compatibility] PHPExcel : IBM AIX iconv() does not work,
- thanks to Björn Wiberg - bwiberg
+ thanks to Björn Wiberg - bwiberg
- bug #2983066 [interface] Flush table on table operations shows the query twice,
- thanks to Martynas Mickevičius - BlinK_
+ thanks to Martynas MickeviÄius - BlinK_
- bug #2983060, patch #2987900 [interface] Fix initial state of tables in
designer, thanks to Sutharshan Balachandren.
- bug #2983062, patch #2989408 [engines] Fix warnings when changing table
@@ -385,7 +391,7 @@ phpMyAdmin - ChangeLog
+ rfe #2839504 [engines] Support InnoDB plugin's new row formats
+ [core] Added ability for synchronizing databases among servers.
+ [lang] #2843101 Dutch update, thanks to scavenger2008
-+ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
++ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
+ [export] Added MediaWiki export module,
thanks to Derek Schaefer - drummingds1
+ [lang] Turkish update, thanks to Burak Yavuz
diff --git a/Documentation.html b/Documentation.html
index 576c1f0..25b9731 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -9,7 +9,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>phpMyAdmin 3.4.3 - Documentation</title>
+ <title>phpMyAdmin 3.4.3.1 - Documentation</title>
<link rel="stylesheet" type="text/css" href="docs.css" />
</head>
@@ -17,7 +17,7 @@ vim: expandtab ts=4 sw=4 sts=4 tw=78
<div id="header">
<h1>
<a href="http://www.phpmyadmin.net/">php<span class="myadmin">MyAdmin</span></a>
- 3.4.3
+ 3.4.3.1
Documentation
</h1>
</div>
diff --git a/README b/README
index 02ad016..e57152a 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================
-Version 3.4.3
+Version 3.4.3.1
A set of PHP-scripts to manage MySQL over the web.
diff --git a/libraries/Config.class.php b/libraries/Config.class.php
index cd1a0bf..28625f2 100644
--- a/libraries/Config.class.php
+++ b/libraries/Config.class.php
@@ -96,7 +96,7 @@ class PMA_Config
*/
function checkSystem()
{
- $this->set('PMA_VERSION', '3.4.3');
+ $this->set('PMA_VERSION', '3.4.3.1');
/**
* @deprecated
*/
diff --git a/libraries/auth/swekey/swekey.auth.lib.php b/libraries/auth/swekey/swekey.auth.lib.php
index d2ec1b1..c5f613b 100644
--- a/libraries/auth/swekey/swekey.auth.lib.php
+++ b/libraries/auth/swekey/swekey.auth.lib.php
@@ -263,11 +263,10 @@ function Swekey_login($input_name, $input_go)
}
}
-if (strstr($_SERVER['QUERY_STRING'],'session_to_unset') != false)
+if (!empty($_GET['session_to_unset']))
{
- parse_str($_SERVER['QUERY_STRING']);
session_write_close();
- session_id($session_to_unset);
+ session_id($_GET['session_to_unset']);
session_start();
$_SESSION = array();
session_write_close();
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 64a0383..c7d74ef 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1308,7 +1308,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
if ($GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) && isset($GLOBALS['mime_map'][$meta->name]['transformation']) && !empty($GLOBALS['mime_map'][$meta->name]['transformation'])) {
- $include_file = $GLOBALS['mime_map'][$meta->name]['transformation'];
+ $include_file = PMA_securePath($GLOBALS['mime_map'][$meta->name]['transformation']);
if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = str_replace('.inc.php', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index ba6f813..c9f1242 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -624,7 +624,7 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
// Replace the src table name with a `dbname`.`tablename`
- $Create_Table_Query = preg_replace('/' . PMA_backquote($uncommon_tables[$table_index]) . '/',
+ $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]),
$Create_Query,
$limit = 1
diff --git a/setup/lib/ConfigGenerator.class.php b/setup/lib/ConfigGenerator.class.php
index 95c3325..e33775e 100644
--- a/setup/lib/ConfigGenerator.class.php
+++ b/setup/lib/ConfigGenerator.class.php
@@ -39,7 +39,7 @@ class ConfigGenerator
if ($cf->getServerCount() > 0) {
$ret .= "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf;
foreach ($c['Servers'] as $id => $server) {
- $ret .= '/* Server: ' . strtr($cf->getServerName($id), '*/', '-') . " [$id] */" . $crlf
+ $ret .= '/* Server: ' . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') . "*/" . $crlf
. '$i++;' . $crlf;
foreach ($server as $k => $v) {
$k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin annotated tag, RELEASE_3_4_3_1, created. RELEASE_3_4_3_1
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The annotated tag, RELEASE_3_4_3_1 has been created
at 11bdba6ae1a4484650f032d36842cf4c4c341be2 (tag)
tagging e214683f9fe4955dcbf0ffce045983728c7fa9d3 (commit)
replaces RELEASE_3_4_3
tagged by Marc Delisle
on Sat Jul 2 21:19:05 2011 -0400
- Log -----------------------------------------------------------------
Released 3.4.3.1
Herman van Rink (4):
Fixed possible session manipulation in swekey authentication, see PMASA-2011-5
Fixed possible code injection incase session variables are compromised, see PMASA-2011-6
Fixed regexp quoting issue in Synchronize code, see PMASA-2011-7
Fixed filtering of a file path, which allowed for directory traversal, see PMASA-2011-8
Marc Delisle (1):
3.4.3.1 release
-----------------------------------------------------------------------
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin annotated tag, RELEASE_3_3_10_2, created. RELEASE_3_3_10_2
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The annotated tag, RELEASE_3_3_10_2 has been created
at 5881d2a9e0cfbd3df4f1b5b60aca82eeda7fad42 (tag)
tagging ab31a2565f494c69e6b0d9a82a2932c7656592b5 (commit)
replaces RELEASE_3_3_10_1
tagged by Marc Delisle
on Sat Jul 2 21:10:55 2011 -0400
- Log -----------------------------------------------------------------
Released 3.3.10.2
Herman van Rink (5):
Fixed possible session corruption in swekey authentication
Fixed possible code injection incase session variables are compromised
Fixed regexp quoting issue in Synchronize code
Updated Changelog to add PMASA references
Fixed filtering of a file path, which allowed for directory traversal, see PMASA-2011-8
Marc Delisle (1):
3.3.10.2 release
-----------------------------------------------------------------------
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3-6497-g12fcc27
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The branch, master has been updated
via 12fcc270f2d0cc7df3a94a131e2f234b0ee8414c (commit)
via 041cd7e7d2dfa95dd055da6fd2eb5308902fda95 (commit)
via 58d86350c439c2ea06d58ba37f723e6e8a8f1abf (commit)
via e214683f9fe4955dcbf0ffce045983728c7fa9d3 (commit)
via b434320eff8ca9c2fc1b043c1804f868341af9a7 (commit)
via 69fb0f8e7dc38075427aceaf09bcac697d0590ff (commit)
via 0fbedaf5fd7a771d0885c6b7385d934fc90d0d7f (commit)
via 7ebd958b2bf59f96fecd5b3322bdbd0b244a7967 (commit)
from a45a11f4e84c19dfa9e4ce0c2e25fc0e9dd8c01f (commit)
- Log -----------------------------------------------------------------
commit 12fcc270f2d0cc7df3a94a131e2f234b0ee8414c
Merge: a45a11f4e84c19dfa9e4ce0c2e25fc0e9dd8c01f 041cd7e7d2dfa95dd055da6fd2eb5308902fda95
Author: Marc Delisle <marc(a)infomarc.info>
Date: Sat Jul 2 20:52:10 2011 -0400
Merge branch 'QA_3_4'
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 18 ++++++++++++------
libraries/auth/swekey/swekey.auth.lib.php | 5 ++---
libraries/display_tbl.lib.php | 2 +-
libraries/server_synchronize.lib.php | 2 +-
setup/lib/ConfigGenerator.class.php | 2 +-
5 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 504f54c..ae70fb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,12 @@ phpMyAdmin - ChangeLog
- bug #3348995 [config] $cfg['Export']['asfile'] set to false does not select asText option
- bug #3340151 [export] Working SQL query exports error page
+3.4.3.1 (2011-07-02)
+- [security] Fixed possible session manipulation in swekey authentication, see PMASA-2011-5
+- [security] Fixed possible code injection incase session variables are compromised, see PMASA-2011-6
+- [security] Fixed regexp quoting issue in Synchronize code, see PMASA-2011-7
+- [security] Fixed filtering of a file path, which allowed for directory traversal, see PMASA-2011-8
+
3.4.3.0 (2011-06-27)
- bug #3311170 [sync] Missing helper icons in Synchronize
- patch #3304473 [setup] Redefine a lable that was wrong
@@ -121,7 +127,7 @@ phpMyAdmin - ChangeLog
+ patch #2974341 [structure] Clicking on table name in db Structure should
Browse the table if possible, thanks to bhdouglass - dougboybhd
+ patch #2975533 [search] New search operators, thanks to
- Martynas Mickevičius
+ Martynas MickeviÄius
+ patch #2967320 [designer] Colored relations based on the primary key,
thanks to GreenRover - greenrover
- [core] Provide way for vendors to easily change paths to config files.
@@ -275,7 +281,7 @@ phpMyAdmin - ChangeLog
3.3.7.0 (2010-09-07)
- patch #3050492 [PDF scratchboard] Cannot drag table box to the edge after
- a page size increase, thanks to Martin Schönberger - mad05
+ a page size increase, thanks to Martin Schönberger - mad05
3.3.6.0 (2010-08-28)
- bug #3033063 [core] Navi gets wrong db name
@@ -296,7 +302,7 @@ phpMyAdmin - ChangeLog
3.3.5.0 (2010-07-26)
- patch #2932113 [information_schema] Slow export when having lots of
- databases, thanks to Stéphane Pontier - shadow_walker
+ databases, thanks to Stéphane Pontier - shadow_walker
- bug #3022705 [import] Import button does not work in Catalan when there
is no progress bar possible
- bug [replication] Do not offer information_schema in the list of databases
@@ -336,9 +342,9 @@ phpMyAdmin - ChangeLog
- patch #2984893 [engines] InnoDB storage page emits a warning,
thanks to Madhura Jayaratne - madhuracj
- bug #2974687, bug #2974692 [compatibility] PHPExcel : IBM AIX iconv() does not work,
- thanks to Björn Wiberg - bwiberg
+ thanks to Björn Wiberg - bwiberg
- bug #2983066 [interface] Flush table on table operations shows the query twice,
- thanks to Martynas Mickevičius - BlinK_
+ thanks to Martynas MickeviÄius - BlinK_
- bug #2983060, patch #2987900 [interface] Fix initial state of tables in
designer, thanks to Sutharshan Balachandren.
- bug #2983062, patch #2989408 [engines] Fix warnings when changing table
@@ -417,7 +423,7 @@ phpMyAdmin - ChangeLog
+ rfe #2839504 [engines] Support InnoDB plugin's new row formats
+ [core] Added ability for synchronizing databases among servers.
+ [lang] #2843101 Dutch update, thanks to scavenger2008
-+ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
++ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
+ [export] Added MediaWiki export module,
thanks to Derek Schaefer - drummingds1
+ [lang] Turkish update, thanks to Burak Yavuz
diff --git a/libraries/auth/swekey/swekey.auth.lib.php b/libraries/auth/swekey/swekey.auth.lib.php
index d2ec1b1..c5f613b 100644
--- a/libraries/auth/swekey/swekey.auth.lib.php
+++ b/libraries/auth/swekey/swekey.auth.lib.php
@@ -263,11 +263,10 @@ function Swekey_login($input_name, $input_go)
}
}
-if (strstr($_SERVER['QUERY_STRING'],'session_to_unset') != false)
+if (!empty($_GET['session_to_unset']))
{
- parse_str($_SERVER['QUERY_STRING']);
session_write_close();
- session_id($session_to_unset);
+ session_id($_GET['session_to_unset']);
session_start();
$_SESSION = array();
session_write_close();
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 3a39bc6..0280d8b 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1383,7 +1383,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
if ($GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) && isset($GLOBALS['mime_map'][$meta->name]['transformation']) && !empty($GLOBALS['mime_map'][$meta->name]['transformation'])) {
- $include_file = $GLOBALS['mime_map'][$meta->name]['transformation'];
+ $include_file = PMA_securePath($GLOBALS['mime_map'][$meta->name]['transformation']);
if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = str_replace('.inc.php', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index 1d8aaa5..a2ea20b 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -610,7 +610,7 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
// Replace the src table name with a `dbname`.`tablename`
- $Create_Table_Query = preg_replace('/' . PMA_backquote($uncommon_tables[$table_index]) . '/',
+ $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]),
$Create_Query,
$limit = 1
diff --git a/setup/lib/ConfigGenerator.class.php b/setup/lib/ConfigGenerator.class.php
index 2872221..f3c6ed8 100644
--- a/setup/lib/ConfigGenerator.class.php
+++ b/setup/lib/ConfigGenerator.class.php
@@ -39,7 +39,7 @@ class ConfigGenerator
if ($cf->getServerCount() > 0) {
$ret .= "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf;
foreach ($c['Servers'] as $id => $server) {
- $ret .= '/* Server: ' . strtr($cf->getServerName($id), '*/', '-') . " [$id] */" . $crlf
+ $ret .= '/* Server: ' . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') . "*/" . $crlf
. '$i++;' . $crlf;
foreach ($server as $k => $v) {
$k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_3-22-g041cd7e
by Marc Delisle 02 Jul '11
by Marc Delisle 02 Jul '11
02 Jul '11
The branch, QA_3_4 has been updated
via 041cd7e7d2dfa95dd055da6fd2eb5308902fda95 (commit)
via 58d86350c439c2ea06d58ba37f723e6e8a8f1abf (commit)
via e214683f9fe4955dcbf0ffce045983728c7fa9d3 (commit)
via b434320eff8ca9c2fc1b043c1804f868341af9a7 (commit)
via 69fb0f8e7dc38075427aceaf09bcac697d0590ff (commit)
via 0fbedaf5fd7a771d0885c6b7385d934fc90d0d7f (commit)
via 7ebd958b2bf59f96fecd5b3322bdbd0b244a7967 (commit)
from 5217946601b64ee6e92f97443cf4e515c03c0c27 (commit)
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 18 ++++++++++++------
libraries/auth/swekey/swekey.auth.lib.php | 5 ++---
libraries/display_tbl.lib.php | 2 +-
libraries/server_synchronize.lib.php | 2 +-
setup/lib/ConfigGenerator.class.php | 2 +-
5 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8ac61c1..6bdeb8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,12 @@ phpMyAdmin - ChangeLog
- bug #3348995 [config] $cfg['Export']['asfile'] set to false does not select asText option
- bug #3340151 [export] Working SQL query exports error page
+3.4.3.1 (2011-07-02)
+- [security] Fixed possible session manipulation in swekey authentication, see PMASA-2011-5
+- [security] Fixed possible code injection incase session variables are compromised, see PMASA-2011-6
+- [security] Fixed regexp quoting issue in Synchronize code, see PMASA-2011-7
+- [security] Fixed filtering of a file path, which allowed for directory traversal, see PMASA-2011-8
+
3.4.3.0 (2011-06-27)
- bug #3311170 [sync] Missing helper icons in Synchronize
- patch #3304473 [setup] Redefine a lable that was wrong
@@ -95,7 +101,7 @@ phpMyAdmin - ChangeLog
+ patch #2974341 [structure] Clicking on table name in db Structure should
Browse the table if possible, thanks to bhdouglass - dougboybhd
+ patch #2975533 [search] New search operators, thanks to
- Martynas Mickevičius
+ Martynas MickeviÄius
+ patch #2967320 [designer] Colored relations based on the primary key,
thanks to GreenRover - greenrover
- [core] Provide way for vendors to easily change paths to config files.
@@ -249,7 +255,7 @@ phpMyAdmin - ChangeLog
3.3.7.0 (2010-09-07)
- patch #3050492 [PDF scratchboard] Cannot drag table box to the edge after
- a page size increase, thanks to Martin Schönberger - mad05
+ a page size increase, thanks to Martin Schönberger - mad05
3.3.6.0 (2010-08-28)
- bug #3033063 [core] Navi gets wrong db name
@@ -270,7 +276,7 @@ phpMyAdmin - ChangeLog
3.3.5.0 (2010-07-26)
- patch #2932113 [information_schema] Slow export when having lots of
- databases, thanks to Stéphane Pontier - shadow_walker
+ databases, thanks to Stéphane Pontier - shadow_walker
- bug #3022705 [import] Import button does not work in Catalan when there
is no progress bar possible
- bug [replication] Do not offer information_schema in the list of databases
@@ -310,9 +316,9 @@ phpMyAdmin - ChangeLog
- patch #2984893 [engines] InnoDB storage page emits a warning,
thanks to Madhura Jayaratne - madhuracj
- bug #2974687, bug #2974692 [compatibility] PHPExcel : IBM AIX iconv() does not work,
- thanks to Björn Wiberg - bwiberg
+ thanks to Björn Wiberg - bwiberg
- bug #2983066 [interface] Flush table on table operations shows the query twice,
- thanks to Martynas Mickevičius - BlinK_
+ thanks to Martynas MickeviÄius - BlinK_
- bug #2983060, patch #2987900 [interface] Fix initial state of tables in
designer, thanks to Sutharshan Balachandren.
- bug #2983062, patch #2989408 [engines] Fix warnings when changing table
@@ -391,7 +397,7 @@ phpMyAdmin - ChangeLog
+ rfe #2839504 [engines] Support InnoDB plugin's new row formats
+ [core] Added ability for synchronizing databases among servers.
+ [lang] #2843101 Dutch update, thanks to scavenger2008
-+ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
++ [lang] Galician update, thanks to Xosé Calvo - xosecalvo
+ [export] Added MediaWiki export module,
thanks to Derek Schaefer - drummingds1
+ [lang] Turkish update, thanks to Burak Yavuz
diff --git a/libraries/auth/swekey/swekey.auth.lib.php b/libraries/auth/swekey/swekey.auth.lib.php
index d2ec1b1..c5f613b 100644
--- a/libraries/auth/swekey/swekey.auth.lib.php
+++ b/libraries/auth/swekey/swekey.auth.lib.php
@@ -263,11 +263,10 @@ function Swekey_login($input_name, $input_go)
}
}
-if (strstr($_SERVER['QUERY_STRING'],'session_to_unset') != false)
+if (!empty($_GET['session_to_unset']))
{
- parse_str($_SERVER['QUERY_STRING']);
session_write_close();
- session_id($session_to_unset);
+ session_id($_GET['session_to_unset']);
session_start();
$_SESSION = array();
session_write_close();
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 64a0383..c7d74ef 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1308,7 +1308,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
if ($GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) && isset($GLOBALS['mime_map'][$meta->name]['transformation']) && !empty($GLOBALS['mime_map'][$meta->name]['transformation'])) {
- $include_file = $GLOBALS['mime_map'][$meta->name]['transformation'];
+ $include_file = PMA_securePath($GLOBALS['mime_map'][$meta->name]['transformation']);
if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = str_replace('.inc.php', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php
index ba6f813..c9f1242 100644
--- a/libraries/server_synchronize.lib.php
+++ b/libraries/server_synchronize.lib.php
@@ -624,7 +624,7 @@ function PMA_createTargetTables($src_db, $trg_db, $src_link, $trg_link, &$uncomm
$Create_Query = PMA_DBI_fetch_value("SHOW CREATE TABLE " . PMA_backquote($src_db) . '.' . PMA_backquote($uncommon_tables[$table_index]), 0, 1, $src_link);
// Replace the src table name with a `dbname`.`tablename`
- $Create_Table_Query = preg_replace('/' . PMA_backquote($uncommon_tables[$table_index]) . '/',
+ $Create_Table_Query = preg_replace('/' . preg_quote(PMA_backquote($uncommon_tables[$table_index]), '/') . '/',
PMA_backquote($trg_db) . '.' .PMA_backquote($uncommon_tables[$table_index]),
$Create_Query,
$limit = 1
diff --git a/setup/lib/ConfigGenerator.class.php b/setup/lib/ConfigGenerator.class.php
index 95c3325..e33775e 100644
--- a/setup/lib/ConfigGenerator.class.php
+++ b/setup/lib/ConfigGenerator.class.php
@@ -39,7 +39,7 @@ class ConfigGenerator
if ($cf->getServerCount() > 0) {
$ret .= "/* Servers configuration */$crlf\$i = 0;" . $crlf . $crlf;
foreach ($c['Servers'] as $id => $server) {
- $ret .= '/* Server: ' . strtr($cf->getServerName($id), '*/', '-') . " [$id] */" . $crlf
+ $ret .= '/* Server: ' . strtr($cf->getServerName($id) . " [$id] ", '*/', '-') . "*/" . $crlf
. '$i++;' . $crlf;
foreach ($server as $k => $v) {
$k = preg_replace('/[^A-Za-z0-9_]/', '_', $k);
hooks/post-receive
--
phpMyAdmin
1
0