fixed bug #486509 - Text fields don't display newlines

This commit is contained in:
Loïc Chapeaux
2001-11-30 21:45:22 +00:00
parent d0c4c15557
commit 6e70f5203b
2 changed files with 14 additions and 4 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2001-11-30 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/display_tbl.lib.php3: fixed bug #486509 - Text fields don't
display newlines.
2001-11-29 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* header.inc.php3, lines 76-83: displays verbose server description
rather than hostname as window title.

View File

@@ -779,8 +779,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
if (strlen($row[$primary->name]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) {
$row[$primary->name] = substr($row[$primary->name], 0, $GLOBALS['cfgLimitChars']) . '...';
}
// loic1: displays <cr>/<lf>
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$primary->name]));
// loic1: displays all space characters, 4 space
// characters for tabulations and <cr>/<lf>
$row[$primary->name] = htmlspecialchars($row[$primary->name]);
$row[$primary->name] = str_replace("\011", '&nbsp;&nbsp;&nbsp;&nbsp;', str_replace(' ', '&nbsp;', $row[$primary->name]));
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
echo ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
} else {
echo ' <td valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
@@ -806,9 +809,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$row[$primary->name] = str_replace("\x0d", '\r', $row[$primary->name]);
$row[$primary->name] = str_replace("\x1a", '\Z', $row[$primary->name]);
}
// loic1: displays <cr>/<lf>
// loic1: displays all space characters, 4 space
// characters for tabulations and <cr>/<lf>
else {
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))+", '<br />', htmlspecialchars($row[$primary->name]));
$row[$primary->name] = htmlspecialchars($row[$primary->name]);
$row[$primary->name] = str_replace("\011", '&nbsp;&nbsp;&nbsp;&nbsp;', str_replace(' ', '&nbsp;', $row[$primary->name]));
$row[$primary->name] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$primary->name]);
}
echo ' <td valign="top" bgcolor="' . $bgcolor . '">' . $row[$primary->name] . '</td>' . "\n";
} else {