Skip to content

Commit

Permalink
fix: use UtilMethods.isSet instead of comparing against null. ref: #3…
Browse files Browse the repository at this point in the history
…0130 (#30663)

This pull request includes a small but important change to the
`VanityUrlAPIImpl.java` file. The change improves the way query strings
are handled when constructing new URLs.

*
[`dotCMS/src/main/java/com/dotcms/vanityurl/business/VanityUrlAPIImpl.java`](diffhunk://#diff-1b71d209a0e8438b81297d8be0bf3b1868c489d30114645b3e0974025de9d5c2L380-R380):
Replaced the null check for `queryString` with a call to
`UtilMethods.isSet(queryString)` to improve readability and consistency.
  • Loading branch information
erickgonzalez authored Nov 14, 2024
1 parent efcc15e commit 95e393b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public boolean handleVanityURLRedirects(final VanityUrlRequestWrapper request, f
final String queryString = request.getQueryString();
final int responseCode = request.getResponseCode();

final String newUrl = uri + (queryString != null ? StringPool.QUESTION + queryString : StringPool.BLANK);
final String newUrl = uri + (UtilMethods.isSet(queryString) ? StringPool.QUESTION + queryString : StringPool.BLANK);

if (responseCode == 301 || responseCode == 302) {
response.setStatus(responseCode);
Expand Down

0 comments on commit 95e393b

Please sign in to comment.