mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
SECURITY: limit amount of links in custom sidebar section (#22543)
Custom sidebar section can have maximum of 50 links Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
This commit is contained in:
@ -11,7 +11,9 @@ class SidebarSection < ActiveRecord::Base
|
||||
source: :linkable,
|
||||
source_type: "SidebarUrl"
|
||||
|
||||
accepts_nested_attributes_for :sidebar_urls, allow_destroy: true
|
||||
accepts_nested_attributes_for :sidebar_urls,
|
||||
allow_destroy: true,
|
||||
limit: -> { SiteSetting.max_sidebar_section_links }
|
||||
|
||||
before_save :set_system_user_for_public_section
|
||||
|
||||
|
Reference in New Issue
Block a user