  def delete_comment_attachment
    Log.add_info(request, params.inspect)

    return unless request.post?

    begin
      attachment = Attachment.find(params[:attachment_id])
      @comment = Comment.find(params[:comment_id])

      if attachment.comment_id == @comment.id
        attachment.destroy
        @comment.update_attribute(:updated_at, Time.now)
      end
    rescue => evar
      Log.add_error(request, evar)
    end

    render(:partial => 'ajax_comment', :layout => false)
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.