FIX: truncate extremely long site name titles (#30977)

This corrects an issue where very long titles on
website would cause the backup not to save
cause filename was too long
This commit is contained in:
Sam
2025-01-24 15:47:05 +11:00
committed by GitHub
parent 8d45755a06
commit 8be16c997e
2 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,13 @@ RSpec.describe BackupRestore::Backuper do
expect(backuper.send(:get_parameterized_title)).to eq("discourse")
end
it "truncates the title to 64 chars" do
SiteSetting.title = "This is th title of a very long site that is going to be truncated"
backuper = BackupRestore::Backuper.new(Discourse.system_user.id)
expect(backuper.send(:get_parameterized_title).length).to eq(64)
end
it "returns a valid parameterized site title" do
SiteSetting.title = "Coding Horror"
backuper = BackupRestore::Backuper.new(Discourse.system_user.id)