Fix: Do not allow empty Hashtags
Sending a hashtag string to PutHashtags in any of these formats: * "," * ",tag" * "tag," * "tag1,,tag2" ...would create an empty tag which could not be deleted using the RESTApi. Change-Id: Ic37a5721de8bfe5846de1a84f6c1c95b96dd9906
This commit is contained in:
parent
30565e12aa
commit
2970f85486
@ -76,7 +76,7 @@ public class PutHashtags implements RestModifyView<ChangeResource, Input> {
|
||||
hashtags.addAll(oldHashtags);
|
||||
};
|
||||
hashtags.addAll(Lists.newArrayList(Splitter.on(CharMatcher.anyOf(",;"))
|
||||
.trimResults().split(input.hashtags)));
|
||||
.trimResults().omitEmptyStrings().split(input.hashtags)));
|
||||
update.setHashtags(hashtags);
|
||||
update.commit();
|
||||
indexer.index(dbProvider.get(), update.getChange());
|
||||
|
Loading…
Reference in New Issue
Block a user