diff --git a/ChangeLog b/ChangeLog index ba65cce72..d44029a95 100755 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,8 @@ $Source$ tbl_properties_structure.php, lang/*, libraries/display_tbl.lib.php, libraries/functions.js, libraries/indexes.js: Show better error messages when checking numerical inputs (bug #1207402). + * sql.php, libraries/common.lib.php: Use post for print view when query is + too big (bug #1203692). 2005-07-10 Marc Delisle * libraries/display_tbl.lib.php: bug #1235473 display_tbl.lib.php, diff --git a/libraries/common.lib.php b/libraries/common.lib.php index a8310f536..ffaf83877 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2144,12 +2144,15 @@ if (typeof(document.getElementById) != 'undefined' * * @return string the results to be echoed or saved in an array */ - function PMA_linkOrButton($url, $message, $js_conf, $allow_button = TRUE) + function PMA_linkOrButton($url, $message, $js_conf, $allow_button = TRUE, $strip_img = FALSE, $target = '') { + if (!empty($target)) { + $target = ' target="' . $target . '"'; + } // previously the limit was set to 2047, it seems 1000 is better if (strlen($url) <= 1000) { $onclick_url = (empty($js_conf) ? '' : ' onclick="return confirmLink(this, \'' . $js_conf . '\')"'); - $link_or_button = ' ' . "\n" + $link_or_button = ' ' . "\n" . ' ' . $message . '' . "\n"; } elseif ($allow_button) { @@ -2157,19 +2160,25 @@ if (typeof(document.getElementById) != 'undefined' $query_parts = explode('&', $edit_url_parts['query']); $link_or_button = '
' . "\n"; + . '" method="post"' . $target . '>' . "\n"; foreach ($query_parts AS $query_pair) { list($eachvar, $eachval) = explode('=', $query_pair); $link_or_button .= ' ' . "\n"; } // end while if (stristr($message, '' . "\n" . '' . "\n"; + if ($strip_img) { + $link_or_button .= ' '; + } else { + $link_or_button .= ' '; + } } else { $link_or_button .= ' ' . "\n" . '' . "\n"; + . htmlspecialchars($message) . '" />'; } + $link_or_button .= "\n" . '' . "\n"; } else { $link_or_button = ' ? '; } // end if... else... diff --git a/sql.php b/sql.php index 5984fc5b5..602c3d9a8 100644 --- a/sql.php +++ b/sql.php @@ -808,19 +808,18 @@ else { . '&repeat_cells=' . $repeat_cells . '&printview=1' . '&sql_query=' . urlencode($sql_query); - echo ' ' . "\n" - . ' ' - . ($cfg['PropertiesIconic'] ? '' . $strPrintView . '' : '') - . $strPrintView . '' . "\n"; + echo ' ' . "\n"; + echo PMA_linkOrButton( + 'sql.php' . $url_query . ((isset($dontlimitchars) && $dontlimitchars == '1') ? '&dontlimitchars=1' : ''), + ($cfg['PropertiesIconic'] ? '' . $strPrintView . '' : '') . $strPrintView, + '', TRUE, TRUE, 'print_view') . "\n"; + if (!$dontlimitchars) { - echo '   ' . "\n" - . ' ' - . ($cfg['PropertiesIconic'] ? '' . $strPrintViewFull . '' : '') - . $strPrintViewFull . '  ' . "\n"; + echo '   ' . "\n"; + echo PMA_linkOrButton( + 'sql.php' . $url_query . '&dontlimitchars=1', + ($cfg['PropertiesIconic'] ? '' . $strPrintViewFull . '' : '') . $strPrintViewFull, + '', TRUE, TRUE, 'print_view') . "\n"; } } // end displays "printable view"