Commit a52417ec authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Escapes attachment ids in TracMigrate (#6996).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4449 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c78f4420
......@@ -167,7 +167,7 @@ namespace :redmine do
has_many :attachments, :class_name => "TracAttachment",
:finder_sql => "SELECT DISTINCT attachment.* FROM #{TracMigrate::TracAttachment.table_name}" +
" WHERE #{TracMigrate::TracAttachment.table_name}.type = 'ticket'" +
' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{id}\''
' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{TracMigrate::TracAttachment.connection.quote_string(id.to_s)}\''
has_many :customs, :class_name => "TracTicketCustom", :foreign_key => :ticket
def ticket_type
......@@ -207,7 +207,7 @@ namespace :redmine do
has_many :attachments, :class_name => "TracAttachment",
:finder_sql => "SELECT DISTINCT attachment.* FROM #{TracMigrate::TracAttachment.table_name}" +
" WHERE #{TracMigrate::TracAttachment.table_name}.type = 'wiki'" +
' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{id}\''
' AND #{TracMigrate::TracAttachment.table_name}.id = \'#{TracMigrate::TracAttachment.connection.quote_string(id.to_s)}\''
def self.columns
# Hides readonly Trac field to prevent clash with AR readonly? method (Rails 2.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment