From 00f6a05e148ee90f04c9f38830cf9f1f601ab041 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 5 Sep 2017 18:29:58 -0700 Subject: [PATCH] if a single entry has bad UTF-8 chars, error out on that entry only instead of the whole conf page --- httemplate/config/config-view.cgi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index b02ab1af3..5f09b128a 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -212,11 +212,15 @@ invoice language options: -
<% encode_entities(join("\n",
-     map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
-         $conf->config($i->key, $agentnum)
-   ) )
-%>
+ +% my $escaped = eval { encode_entities(join("\n", +% map { length($_) > 88 ? substr($_,0,88).'...' : $_ } +% $conf->config($i->key, $agentnum) +% ) ); +% }; +% $escaped = $@ ? '('.encode_entities($@).')' : $escaped; +
<% $escaped %>
+ -- 2.11.0