From dc2f46d3fc34797eec0e349a7da901df2f446502 Mon Sep 17 00:00:00 2001 From: Zbynek Konecny Date: Fri, 17 Mar 2023 15:14:30 +0100 Subject: [PATCH] Make configuration properties explicit --- .../safecss/shared/SafeStylesHostedModeUtils.java | 4 ++++ gwt-safecss/src/main/module.gwt.xml | 2 +- .../safehtml/shared/SafeHtmlHostedModeUtils.java | 2 +- .../safehtml/shared/SafeUriHostedModeUtils.java | 8 ++++---- gwt-safehtml/src/main/module.gwt.xml | 5 +++++ 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gwt-safecss/src/main/java/org/gwtproject/safecss/shared/SafeStylesHostedModeUtils.java b/gwt-safecss/src/main/java/org/gwtproject/safecss/shared/SafeStylesHostedModeUtils.java index 98e0c06..9ebbfa7 100644 --- a/gwt-safecss/src/main/java/org/gwtproject/safecss/shared/SafeStylesHostedModeUtils.java +++ b/gwt-safecss/src/main/java/org/gwtproject/safecss/shared/SafeStylesHostedModeUtils.java @@ -31,6 +31,10 @@ public class SafeStylesHostedModeUtils { private static boolean forceCheck; + static { + setForceCheckValidStyleFromProperty(); + } + /** * Checks if the provided string is a valid style property name. * diff --git a/gwt-safecss/src/main/module.gwt.xml b/gwt-safecss/src/main/module.gwt.xml index 8db9000..1276f72 100644 --- a/gwt-safecss/src/main/module.gwt.xml +++ b/gwt-safecss/src/main/module.gwt.xml @@ -22,6 +22,6 @@ - + diff --git a/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeHtmlHostedModeUtils.java b/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeHtmlHostedModeUtils.java index 170dbd8..55326f3 100644 --- a/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeHtmlHostedModeUtils.java +++ b/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeHtmlHostedModeUtils.java @@ -174,7 +174,7 @@ private static void checkArgument(boolean completeHtml, String message) { @GwtIncompatible @Override public boolean getForceCheckCompleteHtmlFromProperty() { - return System.getProperty(FORCE_CHECK_COMPLETE_HTML) != null; + return "true".equals(System.getProperty(FORCE_CHECK_COMPLETE_HTML)); } } } diff --git a/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeUriHostedModeUtils.java b/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeUriHostedModeUtils.java index 5a0ae60..dbdcef6 100644 --- a/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeUriHostedModeUtils.java +++ b/gwt-safehtml/src/main/java/org/gwtproject/safehtml/shared/SafeUriHostedModeUtils.java @@ -134,7 +134,7 @@ public static void setForceCheckValidUri(boolean check) { // // @VisibleForTesting public static void setForceCheckValidUriFromProperty() { - forceCheckValidUri = impl.getForceCheckValieUriFromProperty(); + forceCheckValidUri = impl.getForceCheckValidUriFromProperty(); } private static class JsImpl { @@ -143,7 +143,7 @@ public boolean isValidUri(String uri) { return true; } - public boolean getForceCheckValieUriFromProperty() { + public boolean getForceCheckValidUriFromProperty() { return false; } } @@ -169,8 +169,8 @@ public boolean isValidUri(String uri) { @GwtIncompatible @Override - public boolean getForceCheckValieUriFromProperty() { - return System.getProperty(FORCE_CHECK_VALID_URI) != null; + public boolean getForceCheckValidUriFromProperty() { + return "true".equals(System.getProperty(FORCE_CHECK_VALID_URI)); } } } diff --git a/gwt-safehtml/src/main/module.gwt.xml b/gwt-safehtml/src/main/module.gwt.xml index 63e828f..03aed4e 100644 --- a/gwt-safehtml/src/main/module.gwt.xml +++ b/gwt-safehtml/src/main/module.gwt.xml @@ -22,4 +22,9 @@ + + + + + \ No newline at end of file