From c3ea6fb22bdc7c728d68388e715aeeffeaa422cb Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 5 Jun 2010 08:20:36 -0400 Subject: [PATCH] bug #3011126 [display] Edit link missing after long query --- ChangeLog | 1 + libraries/common.lib.php | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dca8ffe19..395def4d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug [synchronize] Rows were deleted in target table regardless of the "Would you like to delete..." option - bug [privileges] List of tables not shown when the db name has a wildcard +- bug #3011126 [display] Edit link missing after long query 3.3.3.0 (2010-05-10) - patch #2982480 [navi] Do not group if there would be one table in group, diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 2e184746d..c62d51885 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1191,7 +1191,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice') $url_params['sql_query'] = $sql_query; $url_params['show_query'] = 1; - if (! empty($cfg['SQLQuery']['Edit']) && ! $query_too_big) { + // even if the query is big and was truncated, offer the chance + // to edit it (unless it's enormous, see PMA_linkOrButton() ) + if (! empty($cfg['SQLQuery']['Edit'])) { if ($cfg['EditInWindow'] == true) { $onclick = 'window.parent.focus_querywindow(\'' . PMA_jsFormat($sql_query, false) . '\'); return false;'; } else { @@ -1689,6 +1691,13 @@ function PMA_generate_html_tabs($tabs, $url_params) function PMA_linkOrButton($url, $message, $tag_params = array(), $new_form = true, $strip_img = false, $target = '') { + $url_length = strlen($url); + // with this we should be able to catch case of image upload + // into a (MEDIUM) BLOB; not worth generating even a form for these + if ($url_length > $GLOBALS['cfg']['LinkLengthLimit'] * 100) { + return ''; + } + if (! is_array($tag_params)) { $tmp = $tag_params; $tag_params = array(); @@ -1710,7 +1719,7 @@ function PMA_linkOrButton($url, $message, $tag_params = array(), $tag_params_strings[] = $par_name . '="' . $par_value . '"'; } - if (strlen($url) <= $GLOBALS['cfg']['LinkLengthLimit']) { + if ($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) { // no whitespace within an else Safari will make it part of the link $ret = "\n" . ''