From 33256b590c1bfb79dc103401cb9deb4ccabcc318 Mon Sep 17 00:00:00 2001 From: Aaron Manaloto Date: Tue, 25 Jun 2024 16:26:05 +0800 Subject: [PATCH] Use url_encoded_filename method --- app/controllers/concerns/attachments_copier.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/attachments_copier.rb b/app/controllers/concerns/attachments_copier.rb index 7db9ec05e..3ad9f5db7 100644 --- a/app/controllers/concerns/attachments_copier.rb +++ b/app/controllers/concerns/attachments_copier.rb @@ -7,7 +7,7 @@ def copy_attachments(record) if attachment new_attachment = attachment.copy_to(record.node) - new_filename = ERB::Util.url_encode(new_attachment.filename) + new_filename = new_attachment.url_encoded_filename new_path = full_screenshot_path.gsub( /nodes\/[0-9]+\/attachments\/.+/, "nodes/#{new_attachment.node_id}/attachments/#{new_filename}"