bug #3011126 [display] Edit link missing after long query

This commit is contained in:
Marc Delisle
2010-06-05 08:28:24 -04:00
2 changed files with 12 additions and 2 deletions

View File

@@ -96,6 +96,7 @@ $Id$
- 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,

View File

@@ -1188,7 +1188,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
$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 {
@@ -1766,6 +1768,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();
@@ -1787,7 +1796,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 <a> else Safari will make it part of the link
$ret = "\n" . '<a href="' . $url . '" '
. implode(' ', $tag_params_strings) . '>'