Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Tinebase/js/grid): handle empty json in renderer
Browse files Browse the repository at this point in the history
Change-Id: If0180986f2add380d6116662a0c554558e2a4ce6
Reviewed-on: http://gerrit.tine20.com/customers/18531
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
  • Loading branch information
pschuele authored and corneliusweiss committed Nov 23, 2020
1 parent 80255ee commit 295915d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tine20/Tinebase/js/widgets/grid/jsonRenderer.js
Expand Up @@ -22,8 +22,8 @@ Tine.widgets.grid.jsonRenderer.displayField = function(value) {
return Tine.widgets.grid.jsonRenderer.syntaxHighlight(result);
};

Tine.widgets.grid.jsonRenderer.syntaxHighlight =function(json) {
json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
Tine.widgets.grid.jsonRenderer.syntaxHighlight = function(json) {
json = String(json).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
var cls = 'number';
if (/^"/.test(match)) {
Expand All @@ -39,4 +39,4 @@ Tine.widgets.grid.jsonRenderer.syntaxHighlight =function(json) {
}
return '<span class="' + cls + '">' + match + '</span>';
});
};
};

0 comments on commit 295915d

Please sign in to comment.