summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-09-05 18:30:00 -0700
committerIvan Kohler <ivan@freeside.biz>2017-09-05 18:30:00 -0700
commitcd5f689af969136fb11b017917a0d75aa0fb7808 (patch)
treeba31a1c58aba7ee74f32affa6bfb48243e0c9ab9
parent5daa8d5c842af3ae4b94cc9a4f5c6a0a9cef9eac (diff)
if a single entry has bad UTF-8 chars, error out on that entry only instead of the whole conf page
-rw-r--r--httemplate/config/config-view.cgi14
1 files changed, 9 insertions, 5 deletions
diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi
index edbda5ca9..b95697463 100644
--- a/httemplate/config/config-view.cgi
+++ b/httemplate/config/config-view.cgi
@@ -212,11 +212,15 @@ invoice language options:
<tr>
<td id="<% $agentnum.$i->key.$n %>" bgcolor="#ffffff">
-<font size="-2"><pre><% encode_entities(join("\n",
- map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
- $conf->config($i->key, $agentnum)
- ) )
-%></pre></font>
+
+% my $escaped = eval { encode_entities(join("\n",
+% map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
+% $conf->config($i->key, $agentnum)
+% ) );
+% };
+% $escaped = $@ ? '('.encode_entities($@).')' : $escaped;
+<font size="-2"><pre><% $escaped %></pre></font>
+
</td>
</tr>