define variables only where needed
This commit is contained in:
@@ -7,9 +7,12 @@ $Source$
|
||||
|
||||
2005-11-24 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||
* libraries/grab_globals.lib.php: allow scripts to bypass importing vars
|
||||
* libraries/common.lib.php, libraries/export/sql.php: define variables only
|
||||
where needed, and use NULL to define them, as some places test only for
|
||||
isset and not for content
|
||||
* libraries/common.lib.php, libraries/export/sql.php,
|
||||
libraries/display_tbl.lib.php, libraries/mult_submits.inc.php, sql.php,
|
||||
tbl_replace.php, tbl_row_action.php:
|
||||
define variables only where needed, and use NULL to define them
|
||||
if some places test only for isset and not for content
|
||||
|
||||
|
||||
2005-11-25 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* main.php: move server choice into MySQL container
|
||||
|
@@ -6,6 +6,13 @@
|
||||
* Set of functions used to display the records returned by a sql query
|
||||
*/
|
||||
|
||||
/**
|
||||
* Avoids undefined variables
|
||||
*/
|
||||
if (!isset($pos)) {
|
||||
$pos = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the display mode to use for the results of a sql query
|
||||
*
|
||||
|
@@ -252,7 +252,7 @@ if ( !empty($submit_mult) && !empty($what)) {
|
||||
echo '<input type="hidden" name="disp_direction" value="' . $disp_direction . '" />' . "\n";
|
||||
echo '<input type="hidden" name="repeat_cells" value="' . $repeat_cells . '" />' . "\n";
|
||||
echo '<input type="hidden" name="dontlimitchars" value="' . $dontlimitchars . '" />' . "\n";
|
||||
echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n";
|
||||
echo '<input type="hidden" name="pos" value="' . ( isset( $pos ) ? $pos : 0 ) . '" />' . "\n";
|
||||
echo '<input type="hidden" name="session_max_rows" value="' . $session_max_rows . '" />' . "\n";
|
||||
}
|
||||
?>
|
||||
|
6
sql.php
6
sql.php
@@ -85,6 +85,12 @@ if (isset($find_real_end) && $find_real_end) {
|
||||
$unlim_num_rows = PMA_countRecords($db, $table, TRUE, TRUE);
|
||||
$pos = @((ceil($unlim_num_rows / $session_max_rows) - 1) * $session_max_rows);
|
||||
}
|
||||
/**
|
||||
* Avoids undefined variables
|
||||
*/
|
||||
elseif (!isset($pos)) {
|
||||
$pos = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bookmark add
|
||||
|
@@ -22,6 +22,9 @@ if (isset($sql_query)) {
|
||||
if (!isset($dontlimitchars)) {
|
||||
$dontlimitchars = 0;
|
||||
}
|
||||
if (!isset($pos)) {
|
||||
$pos = 0;
|
||||
}
|
||||
$is_gotofile = FALSE;
|
||||
if (isset($after_insert) && $after_insert == 'new_insert') {
|
||||
$goto = 'tbl_change.php?'
|
||||
|
@@ -4,6 +4,13 @@
|
||||
require_once('./libraries/common.lib.php');
|
||||
require_once('./libraries/mysql_charsets.lib.php');
|
||||
|
||||
/**
|
||||
* Avoids undefined variables
|
||||
*/
|
||||
if (!isset($pos)) {
|
||||
$pos = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* No rows were selected => show again the query and tell that user.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user