Skip to content

Commit

Permalink
📚 Update StringPrep docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Dec 21, 2022
1 parent 1707249 commit bd04eb5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/net/imap/sasl/stringprep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def self.[](table)
#
# Also checks bidirectional characters, when <tt>bidi: true</tt>, which may
# raise a BidiStringError.
#
# +profile+ is an optional string which will be added to any exception that
# is raised (it does not affect behavior).
def check_prohibited!(string, *tables, bidi: false, profile: nil)
tables = TABLE_TITLES.keys.grep(/^C/) if tables.empty?
tables |= %w[C.8] if bidi
Expand All @@ -47,10 +50,11 @@ def check_prohibited!(string, *tables, bidi: false, profile: nil)
# RandALCat character MUST be the last character of the string.
#
# This is usually combined with #check_prohibited!, so table "C.8" is only
# checked when +c_8: true+.
# checked when <tt>c_8: true</tt>.
#
# Raises either ProhibitedCodepoint or BidiStringError unless all
# requirements are met.
# requirements are met. +profile+ is an optional string which will be
# added to any exception that is raised (it does not affect behavior).
def check_bidi!(string, c_8: false, profile: nil)
check_prohibited!(string, "C.8", profile: profile) if c_8
if BIDI_FAILS_REQ2.match?(string)
Expand Down

0 comments on commit bd04eb5

Please sign in to comment.