Skip to content

Entering very long url into linkedin field creates DB error #452

Open
@steveyken

Description

@steveyken

(this occurs on Postgres DB, haven't checked the mysql or sqllite)

  • edit a contact
  • enter a very long link into Linked In field
  • press submit

DB error is thrown:

ActiveRecord::StatementInvalid (PG::StringDataRightTruncation: ERROR:  value too long for type character varying(128)
 : UPDATE "contacts" SET "department" = $1, "fax" = $2, "linkedin" = $3, "skype" = $4, "updated_at" = $5 WHERE "contacts"."id" = $6):
app/models/entities/contact.rb:134:in `update_with_account_and_permissions'
app/controllers/entities/contacts_controller.rb:86:in `block in update'
app/controllers/entities/contacts_controller.rb:85:in `update'

Fields like this should be validated properly in Rails with maxlength as appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions