Comments (12)
Fixed in release 1.6.3 that just went out.
from antisamy.
Thanks for raising this issue. @spassarop - can you confirm the problem (with the provided test case), and see if you can come up with a fix?
from antisamy.
I can confirm. The important
boolean is not used and the code that actually rebuilds the CSS is the following:
if (!isInline) { styleSheet.append('\t'); }
styleSheet.append(name);
styleSheet.append(':');
// append all values
while (value != null) {
styleSheet.append(' ');
styleSheet.append(validator.lexicalValueToString(value));
value = value.getNextLexicalUnit();
}
styleSheet.append(';');
if (!isInline) { styleSheet.append('\n'); }
I guess we could just add "!important"
before the ';'
append with an if
. That for sure make the tests pass and I don't see the inconvenient with just adding the text before ending the CSS property.
from antisamy.
OK. Can you add a test case with and without !important, so we can verify this change only includes it when it is specified, and doesn't add it when it is not specified?
from antisamy.
from antisamy.
@spassarop - Thanks for jumping on this so quick! @mrpeny - We have implemented a quick fix in the 1.6.3 branch. Can you test the fix out to verify it fixes the problem as you'd expect. I want to make sure that the !important added back in is in exactly the right place and works as you expect.
from antisamy.
@davewichers I have checked the implementation in the PR and it looks good to me. I have also included 1.6.3-SNAPSHOT
into our web project and it works as expected. Thank you for your prompt reply. 👍🏼
When do you plan to release 1.6.3
?
from antisamy.
@mrpeny - Thanks for reviewing. I'd like to get the release out tonight. I just have to update some JavaDocs related to the other fix going out with 1.6.3. Then it should be ready to ship.
from antisamy.
Thank you.
from antisamy.
@davewichers when is it expected to appear on Maven Central?
from antisamy.
It's already there I believe.
from antisamy.
It's there now. Thank you. Have a nice weekend!
from antisamy.
Related Issues (20)
- Removing Xerces dependency? HOT 3
- Does Antisamy has support for custom css properties " --* " and css-function " var() " and how to define it in the antisamy policy file? HOT 10
- Enabled noopenerAndNoreferrerAnchors policy drops nofollow HOT 7
- Covering all cases of "rel" attribute in "anchor" tag is quite verbose HOT 3
- Investigate replacing Batik CSS HOT 1
- Dealing with Security Vulnerabilities CVE-2023-26119 HOT 13
- AntiSamy encodes unknown tags despite not being configured that way HOT 6
- GraalVM Support HOT 4
- noopenerAndNoreferrerAnchors policy directive seems disabled by default in 1.7.2 version HOT 2
- How to find if vulnerable script is present in the input HOT 8
- Is there a way to not encode certain HTML Entities? HOT 6
- antisamy:1.7.3 contains batik-css:1.16 that has CVE-2022-44729 vulnerability HOT 1
- Sanitized output for same tainted input differs from AntiSamy 1.7.3 to 1.7.4 HOT 6
- Regex named: "Paragraph", is causing "StackOverFlowError" HOT 8
- the argument 'policy' never be used HOT 1
- antiSamy.scan(input, policy) giving the following as not a valid html. HOT 8
- Prevent formatting and translation of css HOT 3
- Antisamy 1.7.5 version - <body> tag issue HOT 34
- When my runtime environment is a Chinese encoding environment, the list of error messages returned is garbled HOT 3
- Selfclosing Break Line Tag <br /> tag in html content is converted into <br> open tag. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antisamy.