From a6371a7d834bcdafd64e796e67bf12a603d75d74 Mon Sep 17 00:00:00 2001 From: Robert Treat Date: Sat, 9 Jan 2010 16:19:16 -0500 Subject: [PATCH] out error messages in monospaced fonts, so that pg's error pointer to align properly with the error. per gripe from Philippe Cloutier --- classes/Misc.php | 5 +++++ libraries/errorhandler.inc.php | 2 +- themes/default/global.css | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/classes/Misc.php b/classes/Misc.php index 08d4f6e5..35d75254 100644 --- a/classes/Misc.php +++ b/classes/Misc.php @@ -157,6 +157,11 @@ $class = 'pre'; $out = $data->escapeBytea($str); break; + case 'errormsg': + $tag = 'pre'; + $class = 'error'; + $out = htmlspecialchars($str); + break; case 'pre': $tag = 'pre'; $out = htmlspecialchars($str); diff --git a/libraries/errorhandler.inc.php b/libraries/errorhandler.inc.php index 6f17cc45..fd9420be 100644 --- a/libraries/errorhandler.inc.php +++ b/libraries/errorhandler.inc.php @@ -28,7 +28,7 @@ function Error_Handler($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false) $sql = $p1; $inputparams = $p2; - $s = "

{$lang['strsqlerror']}
" . $misc->printVal($errmsg) . "

+ $s = "

{$lang['strsqlerror']}
" . $misc->printVal($errmsg,'errormsg') . "

{$lang['strinstatement']}
" . $misc->printVal($sql) . "

"; echo "
{$s}

\n"; diff --git a/themes/default/global.css b/themes/default/global.css index 1584a9df..90e8282d 100644 --- a/themes/default/global.css +++ b/themes/default/global.css @@ -359,6 +359,12 @@ pre.data font-size: 100%; } +pre.error +{ + font-family: "Lucida Console", "Courier New", "DejaVu Sans Mono", monospace; + font-size: 120%; +} + .intro li { font-weight: bold; @@ -449,4 +455,4 @@ pre.data white-space:pre; } .ac_values {width:100%} -.ac_field {border:1px solid #D9D95F} \ No newline at end of file +.ac_field {border:1px solid #D9D95F} -- 2.39.5