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

    return unless request.post?

    SqlHelper.validate_token([params[:groups], params[:teams]])

    if params[:groups].blank?
      params[:equipment][:groups] = nil
    else
      params[:equipment][:groups] = '|' + params[:groups].join('|') + '|'
    end

    if params[:teams].blank?
      params[:equipment][:teams] = nil
    else
      params[:equipment][:teams] = '|' + params[:teams].join('|') + '|'
    end

    @equipment = Equipment.new(params.require(:equipment).permit(Equipment::PERMIT_BASE))

    begin
      @equipment.save!
    rescue => evar
      Log.add_error(request, evar)
      render(:controller => 'equipment', :action => 'edit')
      return
    end

    flash[:notice] = t('msg.register_success')

    list
    render(:action => 'list')
  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.