Move UploadSecurity public types into PUBLIC_TYPES constant

Move UploadSecurity public types into PUBLIC_TYPES constant

  • this is so plugins can extend the public types if required
diff --git a/lib/upload_security.rb b/lib/upload_security.rb
index 5ce74ec..8876446 100644
--- a/lib/upload_security.rb
+++ b/lib/upload_security.rb
@@ -14,6 +14,7 @@
 # on the current secure? status, otherwise there would be a lot of additional
 # complex queries and joins to perform.
 class UploadSecurity
+  PUBLIC_TYPES = %w[avatar custom_emoji profile_background card_background]
   def initialize(upload, opts = {})
     @upload = upload
     @opts = opts
@@ -53,7 +54,7 @@ class UploadSecurity
   end
 
   def public_type?
-    %w[avatar custom_emoji profile_background card_background].include?(@upload_type)
+    PUBLIC_TYPES.include?(@upload_type)
   end
 
   def uploading_in_composer?

GitHub sha: 36841210

1 Like