Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validating the URL of user home sites #355

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class User < ActiveRecord::Base
has_many :taggings, -> { includes(:tag) }, dependent: :destroy
has_many :tags, -> { distinct }, through: :taggings

validates_format_of :homesite, message: "L’adresse du site Web personnel n’est pas valide", with: URI::regexp(%w(http https)), allow_blank: true
validates :homesite, length: { maximum: 100, message: "L’adresse du site Web personnel est trop longue" }
validates :homesite, http_url: { protocols: ["http", "https"], message: "L’adresse du site Web personnel n’est pas valide" },
length: { maximum: 100, message: "L’adresse du site Web personnel est trop longue" }
validates :name, length: { maximum: 40, message: "Le nom affiché est trop long" }
validates :jabber_id, length: { maximum: 32, message: "L’adresse XMPP est trop longue" }
validates :signature, length: { maximum: 255, message: "La signature est trop longue" }
Expand Down