mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-10-31 19:41:45 +00:00
Use grep -E instead of expr
expr was printing `expr: warning: '^.*[<>"]': using '^' as the first character of a basic regular expression is not portable;`
This commit is contained in:
parent
fe6b27bb59
commit
1522b713da
@ -169,7 +169,7 @@ _clean_email_header() {
|
|||||||
# email
|
# email
|
||||||
_email_has_display_name() {
|
_email_has_display_name() {
|
||||||
_email="$1"
|
_email="$1"
|
||||||
expr "$_email" : '^.*[<>"]' >/dev/null
|
echo "$_email" | grep -q -E '^.*[<>"]'
|
||||||
}
|
}
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -249,7 +249,7 @@ _mime_encoded_word() {
|
|||||||
_text="$1"
|
_text="$1"
|
||||||
# (regex character ranges like [a-z] can be locale-dependent; enumerate ASCII chars to avoid that)
|
# (regex character ranges like [a-z] can be locale-dependent; enumerate ASCII chars to avoid that)
|
||||||
_ascii='] $`"'"[!#%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ~^_abcdefghijklmnopqrstuvwxyz{|}~-"
|
_ascii='] $`"'"[!#%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ~^_abcdefghijklmnopqrstuvwxyz{|}~-"
|
||||||
if expr "$_text" : "^.*[^$_ascii]" >/dev/null; then
|
if echo "$_text" | grep -q -E "^.*[^$_ascii]"; then
|
||||||
# At least one non-ASCII char; convert entire thing to encoded word
|
# At least one non-ASCII char; convert entire thing to encoded word
|
||||||
printf "%s" "=?UTF-8?B?$(printf "%s" "$_text" | _base64)?="
|
printf "%s" "=?UTF-8?B?$(printf "%s" "$_text" | _base64)?="
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user