Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Union policy skipIfEmpty value issue (#199)
.and properly merges skipIfEmpty giving preference to explicit policy choices over defaults. Fixes #197
- Loading branch information
yangbongsoo
committed
Jun 2, 2020
1 parent
3c1c4e3
commit 15bdb96
Showing
5 changed files
with
473 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.owasp.html; | ||
|
||
public enum HtmlTagSkipType { | ||
SKIP(true), | ||
SKIP_BY_DEFAULT(true), | ||
DO_NOT_SKIP(false), | ||
DO_NOT_SKIP_BY_DEFAULT(false); | ||
|
||
private final boolean skipAvailability; | ||
|
||
HtmlTagSkipType(boolean skipAvailability) { | ||
this.skipAvailability = skipAvailability; | ||
} | ||
|
||
public HtmlTagSkipType and(HtmlTagSkipType s) { | ||
if (this == s || s == SKIP_BY_DEFAULT) { | ||
return this; | ||
} | ||
|
||
if (s == DO_NOT_SKIP) { | ||
return s; | ||
} | ||
|
||
if (s == DO_NOT_SKIP_BY_DEFAULT) { | ||
return this; | ||
} | ||
|
||
return SKIP; | ||
} | ||
|
||
public boolean skipAvailability() { | ||
return this.skipAvailability; | ||
} | ||
} |
Oops, something went wrong.