Skip to content

Commit

Permalink
Merge bdd9ee6 into 38f0552
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriakosv committed Mar 13, 2021
2 parents 38f0552 + bdd9ee6 commit ae52afc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/misc/allowed_chars.txt
@@ -0,0 +1 @@
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ÄÖÜäöüß&*$% ':?,-(+.)/
4 changes: 3 additions & 1 deletion lib/sepa_king/converter.rb
Expand Up @@ -15,6 +15,8 @@ def convert(*attributes, options)
end

module InstanceMethods
ALLOWED_CHARS = Regexp.escape(File.read('lib/misc/allowed_chars.txt')).freeze

def convert_text(value)
return unless value

Expand All @@ -29,7 +31,7 @@ def convert_text(value)
gsub(/\n+/,' ').

# Remove all invalid characters
gsub(/[^a-zA-Z0-9ÄÖÜäöüß&*$%\ \'\:\?\,\-\(\+\.\)\/]/, '').
gsub(/[^#{ALLOWED_CHARS}]/, '').

# Remove leading and trailing spaces
strip
Expand Down

0 comments on commit ae52afc

Please sign in to comment.