diff --git a/Changelog.md b/Changelog.md index c5414fd08..8df9c92aa 100644 --- a/Changelog.md +++ b/Changelog.md @@ -25,6 +25,7 @@ The default for including jQuery from a CDN has changed. If you want to continue * Better character limit message [#5151](https://github.com/diaspora/diaspora/pull/5151) * Remember whether a AccountDeletion was performed [#5156](https://github.com/diaspora/diaspora/pull/5156) * Increased the number of notifications shown in drop down bar to 15 [#5129](https://github.com/diaspora/diaspora/pull/5129) +* Increase possible captcha length [#5169](https://github.com/diaspora/diaspora/pull/5169) # 0.4.1.0 diff --git a/config/diaspora.yml.example b/config/diaspora.yml.example index e3a8ecc9f..d9836626e 100644 --- a/config/diaspora.yml.example +++ b/config/diaspora.yml.example @@ -289,7 +289,7 @@ configuration: ## Section ## Captcha image size (default='120x20') #image_size: '120x20' - ## Length of captcha text (default=5) + ## Length of captcha text (default=5)(max=12) #captcha_length: 5 ## Captcha image style (default='simply_green') diff --git a/config/initializers/setup_simple_captcha.rb b/config/initializers/setup_simple_captcha.rb index 69ce517c4..366a5a9f8 100644 --- a/config/initializers/setup_simple_captcha.rb +++ b/config/initializers/setup_simple_captcha.rb @@ -1,7 +1,7 @@ SimpleCaptcha.setup do |sc| sc.image_size = AppConfig.settings.captcha.image_size - sc.length = AppConfig.settings.captcha.captcha_length.to_i + sc.length = [1, [AppConfig.settings.captcha_length.to_i, 12].min].max sc.image_style = AppConfig.settings.captcha.image_style sc.distortion = AppConfig.settings.captcha.distortion p AppConfig.settings.captcha -end \ No newline at end of file +end diff --git a/db/migrate/20140826165533_increase_simple_captcha_limit.rb b/db/migrate/20140826165533_increase_simple_captcha_limit.rb new file mode 100644 index 000000000..b4d43dd64 --- /dev/null +++ b/db/migrate/20140826165533_increase_simple_captcha_limit.rb @@ -0,0 +1,8 @@ +class IncreaseSimpleCaptchaLimit < ActiveRecord::Migration + def self.up + change_column :simple_captcha_data, :value, :string, :limit => 12 + end + def self.down + change_column :simple_captcha_data, :value, :string, :limit => 6 + end +end diff --git a/db/schema.rb b/db/schema.rb index 007a4077f..f8f12929b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140824230505) do +ActiveRecord::Schema.define(version: 20140826165533) do create_table "account_deletions", force: true do |t| t.string "diaspora_handle" @@ -449,7 +449,7 @@ ActiveRecord::Schema.define(version: 20140824230505) do create_table "simple_captcha_data", force: true do |t| t.string "key", limit: 40 - t.string "value", limit: 6 + t.string "value", limit: 12 t.datetime "created_at" t.datetime "updated_at" end