mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
FIX: never attempt to log invalid post numbers
Previously in some cases we would queue logging of invalid post numbers The impact would be we would miss logging an incoming link and would leak an error.
This commit is contained in:
@ -481,6 +481,14 @@ class TopicView
|
||||
@filtered_posts.order(sort_order: :desc).limit(1).pluck(:id).first
|
||||
end
|
||||
|
||||
def current_post_number
|
||||
if highest_post_number.present?
|
||||
post_number > highest_post_number ? highest_post_number : post_number
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def read_posts_set
|
||||
|
Reference in New Issue
Block a user