Skip to content

Commit

Permalink
Properly checked of special char and empty word
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Panasiuk committed Feb 26, 2021
1 parent 4504b96 commit e55f461
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified library/SjpApi.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/CurlHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CurlHelper {

public static String getOutputFromCurl(String word) throws IOException {

if (word.isEmpty() == true){
if (word.trim().isEmpty() == true){
word = "empty";
}

Expand Down
2 changes: 1 addition & 1 deletion src/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static boolean hasSpecyficHTMLTags(String text){
}

public static final String deleteSpecialChar(String text){
text = text.replaceAll("[^\\p{IsAlphabetic}\\p{IsDigit}]", "");
text = text.replaceAll("[^\\p{Alnum}\\s]]?", "");
return text;
}

Expand Down

0 comments on commit e55f461

Please sign in to comment.