mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:03:43 +08:00
FIX: Allow restoring non-subfolder backup to subfolder site (#12537)
`GlobalSetting.relative_url_root` comes from the destination site. We can't be sure whether it was the same on the original site. It's safer to use a wildcard here, so we can backup/restore sites with different relative_url_root values.
This commit is contained in:
parent
abb0a4bae2
commit
35e1e009fa
|
@ -135,8 +135,8 @@ module FileStore
|
|||
end
|
||||
|
||||
def uploads_migrated_to_new_scheme?
|
||||
seeded_image_url = "#{GlobalSetting.relative_url_root}/uploads/#{@current_db}/original/_X/"
|
||||
!Upload.by_users.where("url NOT LIKE '//%' AND url NOT LIKE '#{seeded_image_url}%'").exists?
|
||||
seeded_image_url = "uploads/#{@current_db}/original/_X/"
|
||||
!Upload.by_users.where("url NOT LIKE '//%' AND url NOT LIKE '/%#{seeded_image_url}%'").exists?
|
||||
end
|
||||
|
||||
def migrate_to_s3
|
||||
|
|
Loading…
Reference in New Issue
Block a user