Skip to content

Commit

Permalink
ZCS-12002:failed test case of testBug64974
Browse files Browse the repository at this point in the history
  • Loading branch information
rupeshtelus committed Aug 29, 2022
1 parent ae2a41c commit 5b9a21a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions store/src/java/com/zimbra/cs/html/owasp/OwaspHtmlSanitizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ private String checkUnbalancedTags(String html) {
String start = tagArr[0];
String end = tagArr[1];
String[] arrOfStr = html.split(start);
for (String strAfterSplit : arrOfStr) {
if (!strAfterSplit.equals("") && strAfterSplit.contains(end)) {
formattedHtml = formattedHtml + start + strAfterSplit;
} else {
formattedHtml = formattedHtml + strAfterSplit;
}
//ZCS-12002 ( failed test case for testBug64974 )
//if the html doesn't containing start then skipping other operations
if (arrOfStr.length > 1) {
for (String strAfterSplit : arrOfStr) {
if (!strAfterSplit.equals("") && strAfterSplit.contains(end)) {
formattedHtml = formattedHtml + start + strAfterSplit;
} else {
formattedHtml = formattedHtml + strAfterSplit;
}
}
html = formattedHtml;
formattedHtml = "";
}
html = formattedHtml;
formattedHtml = "";
}
return html;
}
Expand Down

0 comments on commit 5b9a21a

Please sign in to comment.