Skip to content

Commit 56d14e6

Browse files
committed
Sanitize SQL like value
1 parent e7f14f2 commit 56d14e6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/active_storage/service/db_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def delete(key)
6363

6464
def delete_prefixed(prefix)
6565
instrument :delete_prefixed, prefix: prefix do
66-
::ActiveStorageDB::File.where('ref LIKE ?', "#{prefix}%").destroy_all
66+
::ActiveStorageDB::File.where('ref LIKE ?', "#{ApplicationRecord.sanitize_sql_like(prefix)}%").destroy_all
6767
end
6868
end
6969

0 commit comments

Comments
 (0)