diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-02-04 05:00:09 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-02-04 05:00:09 +0000 |
commit | 370e02c311c2c3f12bb7ad3e461321c825653732 (patch) | |
tree | ddee23fd0ad1114468a715f028d88f2ad0e9830c /app/src/main/java/ml/docilealligator | |
parent | 4652b70b376d2a8589bed77ee0f2089eb36b233d (diff) | |
download | infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.tar infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.tar.gz infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.tar.bz2 infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.tar.lz infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.tar.xz infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.tar.zst infinity-for-reddit-370e02c311c2c3f12bb7ad3e461321c825653732.zip |
Trim keywords in PostFilter.isPostAllowed.
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java index 9c8dbcc8..30125ba8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/postfilter/PostFilter.java @@ -170,7 +170,7 @@ public class PostFilter implements Parcelable { if (postFilter.postTitleExcludesStrings != null && !postFilter.postTitleExcludesStrings.equals("")) { String[] titles = postFilter.postTitleExcludesStrings.split(",", 0); for (String t : titles) { - if (!t.equals("") && post.getTitle().toLowerCase().contains(t.toLowerCase())) { + if (!t.trim().equals("") && post.getTitle().toLowerCase().contains(t.toLowerCase().trim())) { return false; } } @@ -178,7 +178,7 @@ public class PostFilter implements Parcelable { if (postFilter.excludeSubreddits != null && !postFilter.excludeSubreddits.equals("")) { String[] subreddits = postFilter.excludeSubreddits.split(",", 0); for (String s : subreddits) { - if (!s.equals("") && post.getSubredditName().equalsIgnoreCase(s)) { + if (!s.trim().equals("") && post.getSubredditName().equalsIgnoreCase(s.trim())) { return false; } } @@ -186,7 +186,7 @@ public class PostFilter implements Parcelable { if (postFilter.excludeUsers != null && !postFilter.excludeUsers.equals("")) { String[] users = postFilter.excludeUsers.split(",", 0); for (String u : users) { - if (!u.equals("") && post.getAuthor().equalsIgnoreCase(u)) { + if (!u.trim().equals("") && post.getAuthor().equalsIgnoreCase(u.trim())) { return false; } } @@ -194,7 +194,7 @@ public class PostFilter implements Parcelable { if (postFilter.excludeFlairs != null && !postFilter.excludeFlairs.equals("")) { String[] flairs = postFilter.excludeFlairs.split(",", 0); for (String f : flairs) { - if (!f.equals("") && post.getFlair().equalsIgnoreCase(f)) { + if (!f.trim().equals("") && post.getFlair().equalsIgnoreCase(f.trim())) { return false; } } @@ -202,7 +202,7 @@ public class PostFilter implements Parcelable { if (postFilter.containFlairs != null && !postFilter.containFlairs.equals("")) { String[] flairs = postFilter.containFlairs.split(",", 0); for (String f : flairs) { - if (!f.equals("") && post.getFlair().equalsIgnoreCase(f)) { + if (!f.trim().equals("") && post.getFlair().equalsIgnoreCase(f.trim())) { return false; } } |