mirror of
https://github.com/neocities/neocities.git
synced 2025-05-21 11:49:38 +02:00
one word tags, fix captcha two word mention
This commit is contained in:
parent
9cedbd086d
commit
ba840423a6
5 changed files with 10 additions and 10 deletions
|
@ -425,12 +425,12 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
if tag.match(/ /)
|
||||
errors.add :tags, "Tag \"#{tag}\" cannot have more than one space between words."
|
||||
errors.add :tags, "Tag \"#{tag}\" cannot have spaces."
|
||||
break
|
||||
end
|
||||
|
||||
if tag.split(' ').length > Tag::NAME_WORDS_MAX
|
||||
errors.add :tags, "Tag \"#{tag}\" cannot be more than two words."
|
||||
errors.add :tags, "Tag \"#{tag}\" cannot be more than #{Tag::NAME_WORDS_MAX} word."
|
||||
break
|
||||
end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class Tag < Sequel::Model
|
||||
NAME_LENGTH_MAX = 20
|
||||
NAME_WORDS_MAX = 2
|
||||
NAME_WORDS_MAX = 1
|
||||
many_to_many :sites
|
||||
|
||||
def before_create
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue