diff --git a/common/src/main/java/com/genexus/CommonUtil.java b/common/src/main/java/com/genexus/CommonUtil.java index 2725bc278..d2a2ec2da 100644 --- a/common/src/main/java/com/genexus/CommonUtil.java +++ b/common/src/main/java/com/genexus/CommonUtil.java @@ -2597,6 +2597,11 @@ public static boolean isAbsoluteURL(String url) return url.startsWith("http://") || url.startsWith("https://") || url.startsWith("ftp://") || url.startsWith("sd:"); } + public static boolean hasUrlQueryString(String url) + { + return url.indexOf("?") >= 0; + } + public static String encodeJSON(String in) { String encoded = JSONObject.quote(in).replaceAll("'", "\\\\u0027"); diff --git a/java/src/main/java/com/genexus/GXutil.java b/java/src/main/java/com/genexus/GXutil.java index f3906f012..aa9c196bb 100644 --- a/java/src/main/java/com/genexus/GXutil.java +++ b/java/src/main/java/com/genexus/GXutil.java @@ -1637,6 +1637,11 @@ public static boolean isAbsoluteURL(String url) return CommonUtil.isAbsoluteURL(url); } + public static boolean hasUrlQueryString(String url) + { + return CommonUtil.hasUrlQueryString(url); + } + public static void ErrorToMessages(String errorId, String errorDescription, GXBaseCollection messages) { if (messages != null) diff --git a/java/src/main/java/com/genexus/internet/HttpContext.java b/java/src/main/java/com/genexus/internet/HttpContext.java index a68d41f1f..f2b7737b3 100644 --- a/java/src/main/java/com/genexus/internet/HttpContext.java +++ b/java/src/main/java/com/genexus/internet/HttpContext.java @@ -497,15 +497,16 @@ public void AddStyleSheetFile(String styleSheet) { AddStyleSheetFile(styleSheet, ""); } + public void AddStyleSheetFile(String styleSheet, String urlBuildNumber) { urlBuildNumber = getURLBuildNumber(styleSheet, urlBuildNumber); AddStyleSheetFile(styleSheet, urlBuildNumber, false); } - private String getURLBuildNumber(String styleSheet, String urlBuildNumber) + private String getURLBuildNumber(String resourcePath, String urlBuildNumber) { - if(urlBuildNumber.isEmpty() && !GXutil.isAbsoluteURL(styleSheet)) + if(urlBuildNumber.isEmpty() && !GXutil.isAbsoluteURL(resourcePath) && !GXutil.hasUrlQueryString(resourcePath)) { return "?" + getCacheInvalidationToken(); }