Skip to content

Commit

Permalink
Merge pull request #4413 from Countly/fix/nullbyte
Browse files Browse the repository at this point in the history
[SER-791]encoding and decoding for \u0000
  • Loading branch information
kanwarujjaval authored Aug 1, 2023
2 parents 535fc8f + 7096c6f commit c26f9f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/lib/countly.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2527,7 +2527,7 @@ countlyCommon.union = function(x, y) {
* @returns {string} encoded string
*/
countlyCommon.encode = function(str) {
return str.replace(/^\$/g, "$").replace(/\./g, '.');
return str.replace(/^\$/g, "$").replace(/\./g, '.').replace(/\u0000/g, "&#9647");
};

/**
Expand All @@ -2536,7 +2536,7 @@ countlyCommon.encode = function(str) {
* @returns {string} decoded string
*/
countlyCommon.decode = function(str) {
return str.replace(/^$/g, "$").replace(/^$/g, '$').replace(/./g, '.').replace(/./g, '.');
return str.replace(/^$/g, "$").replace(/^$/g, '$').replace(/./g, '.').replace(/./g, '.').replace(/&#9647/g, '\u0000');
};

/**
Expand Down

0 comments on commit c26f9f3

Please sign in to comment.