displays a space character if a field is empty to ensure the cell format is used with NS

This commit is contained in:
Loïc Chapeaux
2001-08-23 09:43:59 +00:00
parent 5470a0ce21
commit 82304374cf
2 changed files with 58 additions and 21 deletions

View File

@@ -5,8 +5,12 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-08-23 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* lib.inc.php3, display_table(): displays a space character if a field is
empty to ensure the cell format is used with NS.
2001-08-23 Olivier M<>ller <om@omnis.ch> 2001-08-23 Olivier M<>ller <om@omnis.ch>
* lib.inc.php3: don't add a "/" to $cfgPmaAbsoluteUri if it's empty! * lib.inc.php3: don't add a "/" to $cfgPmaAbsoluteUri if it's empty!
2001-08-22 Robin Johnson <robbat2@orbis-terrarum.net> 2001-08-22 Robin Johnson <robbat2@orbis-terrarum.net>
* config.inc.php3: $cfgServers[1]['connect_type'] preferred connection type * config.inc.php3: $cfgServers[1]['connect_type'] preferred connection type
@@ -35,8 +39,6 @@ $Source$
with a backslash. with a backslash.
- lines 96-100: added a magic feature to append a slash at the end of - lines 96-100: added a magic feature to append a slash at the end of
$cfgPmaAbsoluteUri if required. $cfgPmaAbsoluteUri if required.
- display_table(): displays a space character if a field is empty to
ensure the cell format is used with NS.
- defines $server_port & $server_socket only once. - defines $server_port & $server_socket only once.
* main.php3: XHTML1.0 fixes. * main.php3: XHTML1.0 fixes.
* footer.inc.php3, lines 9-10; lib.inc.php3, line 162: the "</body>" html * footer.inc.php3, lines 9-10; lib.inc.php3, line 162: the "</body>" html

View File

@@ -301,17 +301,30 @@ if (!defined('__LIB_INC__')){
if ($do_auth) { if ($do_auth) {
auth(); auth();
} else { } else {
$bkp_track_err = (PHP_INT_VERSION >= 40000) ? @ini_set('track_errors', 1) : '';
$dbh = @$connect_func( $dbh = @$connect_func(
$cfgServer['host'] . $server_port . $server_socket, $cfgServer['host'] . $server_port . $server_socket,
$cfgServer['stduser'], $cfgServer['stduser'],
$cfgServer['stdpass'] $cfgServer['stdpass']
); );
if ($dbh == FALSE) { if ($dbh == FALSE) {
$local_query = $connect_func . '(' if (mysql_error()) {
. $cfgServer['host'] . $server_port . $server_socket . ', ' $conn_error = mysql_error();
. $cfgServer['stduser'] . ', ' } else if (isset($php_errormsg)) {
. $cfgServer['stdpass'] . ')'; $conn_error = $php_errormsg;
mysql_die('', $local_query, FALSE, FALSE); } else {
$conn_error = 'Cannot connect: invalid settings.';
}
if (PHP_INT_VERSION >= 40000) {
@ini_set('track_errors', $bkp_track_err);
}
$local_query = $connect_func . '('
. $cfgServer['host'] . $server_port . $server_socket . ', '
. $cfgServer['stduser'] . ', '
. $cfgServer['stdpass'] . ')';
mysql_die($conn_error, $local_query, FALSE, FALSE);
} else if (PHP_INT_VERSION >= 40000) {
@ini_set('track_errors', $bkp_track_err);
} }
$PHP_AUTH_USER = str_replace('\'', '\\\'', $PHP_AUTH_USER); $PHP_AUTH_USER = str_replace('\'', '\\\'', $PHP_AUTH_USER);
@@ -400,19 +413,31 @@ if (!defined('__LIB_INC__')){
} // end Advanced authentication } // end Advanced authentication
// Do connect to the user's database // Do connect to the user's database
$bkp_track_err = (PHP_INT_VERSION >= 40000) ? @ini_set('track_errors', 1) : '';
$link = @$connect_func( $link = @$connect_func(
$cfgServer['host'] . $server_port . $server_socket, $cfgServer['host'] . $server_port . $server_socket,
$cfgServer['user'], $cfgServer['user'],
$cfgServer['password'] $cfgServer['password']
); );
if ($link == FALSE) { if ($link == FALSE) {
$local_query = $connect_func . '(' if (mysql_error()) {
. $cfgServer['host'] . $server_port . $server_socket . ', ' $conn_error = mysql_error();
. $cfgServer['user'] . ', ' } else if (isset($php_errormsg)) {
. $cfgServer['password'] . ')'; $conn_error = $php_errormsg;
mysql_die('', $local_query, FALSE, FALSE); } else {
$conn_error = 'Cannot connect: invalid settings.';
}
if (PHP_INT_VERSION >= 40000) {
@ini_set('track_errors', $bkp_track_err);
}
$local_query = $connect_func . '('
. $cfgServer['host'] . $server_port . $server_socket . ', '
. $cfgServer['user'] . ', '
. $cfgServer['password'] . ')';
mysql_die($conn_error, $local_query, FALSE, FALSE);
} else if (PHP_INT_VERSION >= 40000) {
@ini_set('track_errors', $bkp_track_err);
} }
} // end server connecting } // end server connecting
/** /**
@@ -1202,7 +1227,11 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
} }
$primary = mysql_fetch_field($dt_result, $i); $primary = mysql_fetch_field($dt_result, $i);
if ($primary->numeric == 1) { if ($primary->numeric == 1) {
echo ' <td align="right">' . $row[$i] . '</td>' . "\n"; if (empty($row[$i])) {
echo ' <td align="right">&nbsp;</td>' . "\n";
} else {
echo ' <td align="right">' . $row[$i] . '</td>' . "\n";
}
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) { } else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $primary->type)) {
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT // loic1 : mysql_fetch_fields returns BLOB in place of TEXT
// fields type, however TEXT fields must be displayed even // fields type, however TEXT fields must be displayed even
@@ -1218,15 +1247,21 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
$row[$i] = substr($row[$i], 0, $GLOBALS['cfgLimitChars']) . '...'; $row[$i] = substr($row[$i], 0, $GLOBALS['cfgLimitChars']) . '...';
} }
// loic1 : displays <cr>/<lf> // loic1 : displays <cr>/<lf>
// echo ' <td>' . htmlspecialchars($row[$i]) . '</td>' . "\n"; if (!empty($row[$i])) {
$row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i])); $row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i]));
echo ' <td>' . $row[$i] . '</td>' . "\n"; echo ' <td>' . $row[$i] . '</td>' . "\n";
} else {
echo ' <td>&nbsp;</td>' . "\n";
}
} }
} else { } else {
// loic1 : displays <cr>/<lf> // loic1 : displays <cr>/<lf>
// echo ' <td>' . htmlspecialchars($row[$i]) . '</td>' . "\n"; if (!empty($row[$i])) {
$row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i])); $row[$i] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$i]));
echo ' <td>' . $row[$i] . '</td>' . "\n"; echo ' <td>' . $row[$i] . '</td>' . "\n";
} else {
echo ' <td>&nbsp;</td>' . "\n";
}
} }
} // end for } // end for
// Possibility to have the modify/delete button on the left added // Possibility to have the modify/delete button on the left added