Bug #835854: Wordwrapping mysql error message

This commit is contained in:
Garvin Hicking
2003-11-05 10:21:56 +00:00
parent 47559a4a83
commit e733e4a924
2 changed files with 19 additions and 2 deletions

View File

@@ -503,9 +503,20 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
echo '<p>' . "\n"
. ' ' . $GLOBALS['strMySQLSaid'] . '<br />' . "\n"
. '</p>' . "\n";
echo '<pre>' . "\n"
// The error message will be displayed within a CODE segment.
// To preserve original formatting, but allow wordwrapping, we do a couple of replacements
// Replace all non-single blanks with their HTML-counterpart
$error_message = str_replace(' ', '&nbsp;&nbsp;', $error_message);
// Replace TAB-characters with their HTML-counterpart
$error_message = str_replace("\t", '&nbsp;&nbsp;&nbsp;&nbsp;', $error_message);
// Replace linebreaks
$error_message = nl2br($error_message);
echo '<code>' . "\n"
. $error_message . "\n"
. '</pre>' . "\n";
. '</code><br /><br />' . "\n";
echo PMA_showMySQLDocu('Error-returns', 'Error-returns');