Use post for print view when query is too big (bug #1203692).
This commit is contained in:
@@ -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 <lem9@users.sourceforge.net>
|
||||
* libraries/display_tbl.lib.php: bug #1235473 display_tbl.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 = ' <a href="' . $url . '"' . $onclick_url . '>' . "\n"
|
||||
$link_or_button = ' <a href="' . $url . '"' . $onclick_url . $target . '>' . "\n"
|
||||
. ' ' . $message . '</a>' . "\n";
|
||||
}
|
||||
elseif ($allow_button) {
|
||||
@@ -2157,19 +2160,25 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
$query_parts = explode('&', $edit_url_parts['query']);
|
||||
$link_or_button = ' <form action="'
|
||||
. $edit_url_parts['path']
|
||||
. '" method="post">' . "\n";
|
||||
. '" method="post"' . $target . '>' . "\n";
|
||||
foreach ($query_parts AS $query_pair) {
|
||||
list($eachvar, $eachval) = explode('=', $query_pair);
|
||||
$link_or_button .= ' <input type="hidden" name="' . str_replace('amp;', '', $eachvar) . '" value="' . htmlspecialchars(urldecode($eachval)) . '" />' . "\n";
|
||||
} // end while
|
||||
|
||||
if (stristr($message, '<img')) {
|
||||
if ($strip_img) {
|
||||
$link_or_button .= ' <input type="submit" value="'
|
||||
. preg_replace('@<img[^>]*>@', '', $message) . '" />';
|
||||
} else {
|
||||
$link_or_button .= ' <input type="image" src="' . preg_replace('@^.*src="(.*)".*$@si', '\1', $message) . '" value="'
|
||||
. htmlspecialchars(preg_replace('@^.*alt="(.*)".*$@si', '\1', $message)) . '" />' . "\n" . '</form>' . "\n";
|
||||
. htmlspecialchars(preg_replace('@^.*alt="(.*)".*$@si', '\1', $message)) . '" />';
|
||||
}
|
||||
} else {
|
||||
$link_or_button .= ' <input type="submit" value="'
|
||||
. htmlspecialchars($message) . '" />' . "\n" . '</form>' . "\n";
|
||||
. htmlspecialchars($message) . '" />';
|
||||
}
|
||||
$link_or_button .= "\n" . '</form>' . "\n";
|
||||
} else {
|
||||
$link_or_button = ' <dfn title="' . $GLOBALS['strNeedPrimaryKey'] . '">?</dfn> ';
|
||||
} // end if... else...
|
||||
|
23
sql.php
23
sql.php
@@ -808,19 +808,18 @@ else {
|
||||
. '&repeat_cells=' . $repeat_cells
|
||||
. '&printview=1'
|
||||
. '&sql_query=' . urlencode($sql_query);
|
||||
echo ' <!-- Print view -->' . "\n"
|
||||
. ' <a href="sql.php' . $url_query
|
||||
. ((isset($dontlimitchars) && $dontlimitchars == '1') ? '&dontlimitchars=1' : '')
|
||||
. '" target="print_view">'
|
||||
. ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_print.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strPrintView . '"/>' : '')
|
||||
. $strPrintView . '</a>' . "\n";
|
||||
echo ' <!-- Print view -->' . "\n";
|
||||
echo PMA_linkOrButton(
|
||||
'sql.php' . $url_query . ((isset($dontlimitchars) && $dontlimitchars == '1') ? '&dontlimitchars=1' : ''),
|
||||
($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_print.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strPrintView . '"/>' : '') . $strPrintView,
|
||||
'', TRUE, TRUE, 'print_view') . "\n";
|
||||
|
||||
if (!$dontlimitchars) {
|
||||
echo ' ' . "\n"
|
||||
. ' <a href="sql.php' . $url_query
|
||||
. '&dontlimitchars=1'
|
||||
. '" target="print_view">'
|
||||
. ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_print.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strPrintViewFull . '" />' : '')
|
||||
. $strPrintViewFull . '</a> ' . "\n";
|
||||
echo ' ' . "\n";
|
||||
echo PMA_linkOrButton(
|
||||
'sql.php' . $url_query . '&dontlimitchars=1',
|
||||
($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_print.png" border="0" height="16" width="16" align="middle" hspace="2" alt="' . $strPrintViewFull . '"/>' : '') . $strPrintViewFull,
|
||||
'', TRUE, TRUE, 'print_view') . "\n";
|
||||
}
|
||||
} // end displays "printable view"
|
||||
|
||||
|
Reference in New Issue
Block a user