diff --git a/libraries/server_synchronize.lib.php b/libraries/server_synchronize.lib.php index 339c1a90c..dfddffb4b 100644 --- a/libraries/server_synchronize.lib.php +++ b/libraries/server_synchronize.lib.php @@ -609,7 +609,7 @@ function PMA_insertIntoTargetTable($matching_table, $src_db, $trg_db, $src_link, } $insert_query .= ");"; if ($display == true) { - echo "
".$insert_query."
"; + PMA_displayQuery($insert_query); } PMA_DBI_try_query($insert_query, $trg_link, 0); } @@ -711,7 +711,7 @@ function PMA_populateTargetTables($src_db, $trg_db, $src_link, $trg_link, $uncom } $insert_query .= ');'; if ($display == true) { - echo ''.$insert_query.'
'; + PMA_displayQuery($insert_query); } PMA_DBI_try_query($insert_query, $trg_link, 0); } @@ -1347,4 +1347,18 @@ function PMA_applyIndexesDiff ($trg_db, $trg_link, $matching_tables, $source_ind PMA_DBI_try_query($drop_index_query, $trg_link, 0); } } + +/** + * PMA_displayQuery() displays a query, taking the maximum display size + * into account + * @uses $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] + * + * @param $query the query to display +*/ +function PMA_displayQuery($query) { + if (strlen($query) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { + $query = substr($query, 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]'; + } + echo '' . htmlspecialchars($query) . '
'; +} ?>