mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Make sure max_oneboxes_per_post is enforced (#16215)
PostAnalyzer and CookedPostProcessor both replace URLs with oneboxes. PostAnalyzer did not use the max_oneboxes_per_post site and setting and CookedPostProcessor replaced at most max_oneboxes_per_post URLs ignoring the oneboxes that were replaced already by PostAnalyzer.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
module CookedProcessorMixin
|
||||
|
||||
def post_process_oneboxes
|
||||
limit = SiteSetting.max_oneboxes_per_post
|
||||
limit = SiteSetting.max_oneboxes_per_post - @doc.css("aside.onebox, a.inline-onebox").size
|
||||
oneboxes = {}
|
||||
inlineOneboxes = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user