mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Even more safety, the topic must exist as well.
This commit is contained in:
parent
5fb962a65f
commit
44ed0d5232
@ -49,7 +49,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||
absolutize_urls(url, contents)
|
||||
post = embed.post
|
||||
# Update the topic if it changed
|
||||
if post && content_sha1 != embed.content_sha1
|
||||
if post && && post.topic && content_sha1 != embed.content_sha1
|
||||
revisor = PostRevisor.new(post)
|
||||
revisor.revise!(user, absolutize_urls(url, contents), skip_validations: true, bypass_rate_limiter: true)
|
||||
embed.update_column(:content_sha1, content_sha1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user