Skip to content

Commit

Permalink
Update StylingPolicy.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ioleo authored Sep 13, 2023
1 parent 35c506c commit 8efc27a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/org/owasp/html/StylingPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ private void closeQuotedIdents() {
}

private void sanitizeAndAppendUrl(String urlContent) {
if (urlContent.length() < 1024) {
String rewrittenUrl = urlRewriter.apply(urlContent);
if (rewrittenUrl != null && !rewrittenUrl.isEmpty()) {
if (hasTokens) { sanitizedCss.append(' '); }
sanitizedCss.append("url('").append(rewrittenUrl).append("')");
hasTokens = true;
}
String rewrittenUrl = urlRewriter.apply(urlContent);
if (rewrittenUrl != null && !rewrittenUrl.isEmpty()) {
if (hasTokens) { sanitizedCss.append(' '); }
sanitizedCss.append("url('").append(rewrittenUrl).append("')");
hasTokens = true;
}
}

Expand Down

0 comments on commit 8efc27a

Please sign in to comment.