about summary refs log tree commit diff
path: root/app/lib/activitypub
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-12-17 13:31:56 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-12-17 13:31:56 +0100
commitda2143b3089ec16fca449b97acbfb65acfe92197 (patch)
treeefce61c5a3092442d477bc555fe1f63becbc52d6 /app/lib/activitypub
parent3830c0b74168070cdd410d311ba85a3b323bca9f (diff)
Fixes featured hashtag setting page erroring out instead of rejecting invalid tags (#12436)
* Revert "Fix ignoring whole status because of one invalid hashtag (#11621)"

This reverts commit dff46b260b2f7d765d254c84a4b89105c7de5e97.

* Fix statuses being rejected because of invalid hashtag names

* Add spec for invalid hashtag names in statuses

* Add test for featured tags controller
Diffstat (limited to 'app/lib/activitypub')
-rw-r--r--app/lib/activitypub/activity/create.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index 8a12a2b08..756d5cb1c 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -157,7 +157,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
     return if tag['name'].blank?
 
     Tag.find_or_create_by_names(tag['name']) do |hashtag|
-      @tags << hashtag unless @tags.include?(hashtag)
+      @tags << hashtag unless @tags.include?(hashtag) || !hashtag.valid?
     end
   rescue ActiveRecord::RecordInvalid
     nil