From: Claire Date: Thu, 11 Mar 2021 15:08:15 +0000 (+0100) Subject: Merge branch 'main' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=1b6a21e6bc7ec9c0d5bb3daf2646d003ba90404c;p=mastodon.git Merge branch 'main' into glitch-soc/merge-upstream Conflicts: - `app/validators/status_length_validator.rb`: Conflict due to glitch-soc's configurable maximum toot chars. Ported upstream changes. --- 1b6a21e6bc7ec9c0d5bb3daf2646d003ba90404c diff --cc app/validators/status_length_validator.rb index dcbc4a41a,d036f1925..11997024f --- a/app/validators/status_length_validator.rb +++ b/app/validators/status_length_validator.rb @@@ -1,13 -1,7 +1,7 @@@ # frozen_string_literal: true class StatusLengthValidator < ActiveModel::Validator - MAX_CHARS = 500 + MAX_CHARS = (ENV['MAX_TOOT_CHARS'] || 500).to_i - URL_PATTERN = %r{ - (?: - (#{Twitter::TwitterText::Regex[:valid_url_preceding_chars]}) - (#{FetchLinkCardService::URL_PATTERN}) - ) - }iox URL_PLACEHOLDER = "\1#{'x' * 23}" def validate(status)