From a4ec378179f33a98e9d07e21e36cb1523e10094c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 9 Jul 2017 10:49:16 +0200 Subject: [PATCH] Move spacing around buttons to Util::getMessage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We really do not want to add spacing around all buttons, just the ones in the SQL message. Fixes #13445 Signed-off-by: Michal Čihař --- ChangeLog | 1 + libraries/Util.php | 32 ++++++++++++------------- test/classes/DisplayResultsTest.php | 36 ++++++++++++++--------------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index e54fa938ea..755c16ff6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog 4.7.3 (not yet released) - issue #13447 Large multi-line query removes Export operation and blanks query box options +- issue #13445 Fixed rendering of query results 4.7.2 (2017-06-29) - issue #13314 Make theme selection keep current server diff --git a/libraries/Util.php b/libraries/Util.php index 57715edeff..d1be48b662 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -1061,18 +1061,18 @@ class Util $explain_params = $url_params; if ($is_select) { $explain_params['sql_query'] = 'EXPLAIN ' . $sql_query; - $explain_link = ' [' + $explain_link = ' [ ' . self::linkOrButton( 'import.php' . URL::getCommon($explain_params), __('Explain SQL') - ) . ']'; + ) . ' ]'; } elseif (preg_match( '@^EXPLAIN[[:space:]]+SELECT[[:space:]]+@i', $sql_query )) { $explain_params['sql_query'] = mb_substr($sql_query, 8); - $explain_link = ' [' + $explain_link = ' [ ' . self::linkOrButton( 'import.php' . URL::getCommon($explain_params), __('Skip Explain SQL') @@ -1088,7 +1088,7 @@ class Util true, false, '_blank' - ) . ']'; + ) . ' ]'; } } //show explain @@ -1101,9 +1101,9 @@ class Util && empty($GLOBALS['show_as_php']) ) { $edit_link .= URL::getCommon($url_params) . '#querybox'; - $edit_link = ' [' + $edit_link = ' [ ' . self::linkOrButton($edit_link, __('Edit')) - . ']'; + . ' ]'; } else { $edit_link = ''; } @@ -1113,7 +1113,7 @@ class Util if (! empty($cfg['SQLQuery']['ShowAsPHP']) && ! $query_too_big) { if (! empty($GLOBALS['show_as_php'])) { - $php_link = ' [' + $php_link = ' [ ' . self::linkOrButton( 'import.php' . URL::getCommon($url_params), __('Without PHP code'), @@ -1123,9 +1123,9 @@ class Util '', true ) - . ']'; + . ' ]'; - $php_link .= ' [' + $php_link .= ' [ ' . self::linkOrButton( 'import.php' . URL::getCommon($url_params), __('Submit query'), @@ -1135,17 +1135,17 @@ class Util '', true ) - . ']'; + . ' ]'; } else { $php_params = $url_params; $php_params['show_as_php'] = 1; $_message = __('Create PHP code'); - $php_link = ' [' + $php_link = ' [ ' . self::linkOrButton( 'import.php' . URL::getCommon($php_params), $_message ) - . ']'; + . ' ]'; } } else { $php_link = ''; @@ -1157,8 +1157,8 @@ class Util && preg_match('@^(SELECT|SHOW)[[:space:]]+@i', $sql_query) ) { $refresh_link = 'import.php' . URL::getCommon($url_params); - $refresh_link = ' [' - . self::linkOrButton($refresh_link, __('Refresh')) . ']'; + $refresh_link = ' [ ' + . self::linkOrButton($refresh_link, __('Refresh')) . ' ]'; } else { $refresh_link = ''; } //refresh @@ -1833,9 +1833,9 @@ class Util } // no whitespace within an else Safari will make it part of the link - $ret = ' ' - . $message . $displayed_message . ' '; + . $message . $displayed_message . ''; } else { // no spaces (line breaks) at all // or after the hidden fields diff --git a/test/classes/DisplayResultsTest.php b/test/classes/DisplayResultsTest.php index 4e4066b676..61c857fe92 100644 --- a/test/classes/DisplayResultsTest.php +++ b/test/classes/DisplayResultsTest.php @@ -434,13 +434,13 @@ class DisplayResultsTest extends PMATestCase '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', '' - . ' ' + . '' . ' Edit ' + . 'alt="Edit" class="icon ic_b_edit" /> Edit' . '' ) @@ -497,13 +497,13 @@ class DisplayResultsTest extends PMATestCase '%60customer%60.%60id%60+%3D+1', 'klass', ' ' + . '"nowrap">' . ' Copy ' + . 'alt="Copy" class="icon ic_b_insrow" /> Copy' . '' ) @@ -560,7 +560,7 @@ class DisplayResultsTest extends PMATestCase . 'alt="Delete" class="icon ic_b_drop" /> Delete', 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', 'klass', - ' ' + '' . 'Delete ' - . 'Delete ' + . 'Delete' . '
DELETE FROM `Data`.`customer` WHERE ' . '`customer`.`id` = 1
' ) @@ -656,24 +656,24 @@ class DisplayResultsTest extends PMATestCase . 'value="%60new%60.%60id%60+%3D+1" />  ' + . '"nowrap">' . '' . ' Edit ' + . 'alt="Edit" class="icon ic_b_edit" /> Edit' . ' ' + . '="nowrap">' . 'Copy Copy ' + . 'class="icon ic_b_insrow" /> Copy' . ' ' + . '%60+%3D+1" />' . 'Delete ' - . 'Delete ' + . 'Delete' . '
DELETE FROM `data`.`new` WHERE `new`.`id` = 1' . '
' ), @@ -723,7 +723,7 @@ class DisplayResultsTest extends PMATestCase ' Delete', 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', - ' ' + '' . 'Delete Delete' - . ' 
DELETE FROM `data`.`new` WHERE `new`.' + . '
DELETE FROM `data`.`new` WHERE `new`.' . '`id` = 1
' - . ' Copy Copy ' + . 'class="icon ic_b_insrow" /> Copy' . '' - . ' ' + . '' . 'Edit Edit ' + . '="icon ic_b_edit" /> Edit' . '