if a single entry has bad UTF-8 chars, error out on that entry only instead of the...
authorIvan Kohler <ivan@freeside.biz>
Wed, 6 Sep 2017 01:30:02 +0000 (18:30 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 6 Sep 2017 01:30:02 +0000 (18:30 -0700)
httemplate/config/config-view.cgi

index a52c1e9..7b2e55a 100644 (file)
@@ -200,11 +200,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>