From b4722fdccda2cd73a49c2dabb8521ad2d81a9b65 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 3 Feb 2016 02:35:41 -0800 Subject: [PATCH] web: show UTF8 chars in result stderr_out correctly (from Marius Millea) --- html/inc/db.inc | 2 +- html/inc/db_ops.inc | 9 ++++++++- html/inc/result.inc | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/html/inc/db.inc b/html/inc/db.inc index d2113ec742..0238e80475 100644 --- a/html/inc/db.inc +++ b/html/inc/db.inc @@ -49,7 +49,7 @@ if (MYSQLI) { } else { $port = null; } - $mysqli = new mysqli($host, $user, $pass, $dbname, $port); + $mysqli = @new mysqli($host, $user, $pass, $dbname, $port); return $mysqli; } function _mysql_query($q) { diff --git a/html/inc/db_ops.inc b/html/inc/db_ops.inc index ee55c31aa9..298a6940b7 100644 --- a/html/inc/db_ops.inc +++ b/html/inc/db_ops.inc @@ -1057,7 +1057,14 @@ function show_result_ops($result) { row("Priority",$result->priority); row("XML doc in", "
".htmlspecialchars($result->xml_doc_in)."
"); row("XML doc out", "
".htmlspecialchars($result->xml_doc_out)."
"); - row("stderr out", "
".htmlspecialchars($result->stderr_out)."
"); + row("stderr out", "
"
+        .htmlspecialchars(
+            $result->stderr_out,
+            ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0),
+            'utf-8'
+        )
+        ."
" + ); end_table(); echo "
diff --git a/html/inc/result.inc b/html/inc/result.inc index 5267046c27..f8546c26b3 100644 --- a/html/inc/result.inc +++ b/html/inc/result.inc @@ -687,7 +687,14 @@ function show_result($result, $show_outfile_links=false) { row2(tra("Output files"), $x); } end_table(); - echo "

".tra("Stderr output")."

".htmlspecialchars($result->stderr_out)."
"; + echo "

".tra("Stderr output")."

"
+        .htmlspecialchars(
+            $result->stderr_out,
+            ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0),
+            'utf-8'
+        )
+        ."
" + ; } function result_navigation($info, $where_clause) {