Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle question mark in encoded text #1452

Merged
merged 5 commits into from
Oct 20, 2021

Conversation

lewispb
Copy link
Contributor

@lewispb lewispb commented Oct 11, 2021

This PR updates the ENCODED_VALUE regex to handle an iso-8859-1 encoded value with a question mark in the middle of the text. This is an example string:

=?iso-8859-1?Q?Hello World?_-_How are you??=

I've also refactored the regexes to use the free-spacing option. This lets us comment each line of the regex improving readability.

lib/mail/constants.rb Outdated Show resolved Hide resolved
lib/mail/constants.rb Outdated Show resolved Hide resolved
lib/mail/constants.rb Outdated Show resolved Hide resolved
@lewispb lewispb requested a review from jeremy October 12, 2021 12:15
\?\= # literal ?=
}mix # m is multi-line, i is case-insensitive, x is free-spacing

FULL_ENCODED_VALUE = %r{ # Identical to ENCODED_VALUE but captures the whole rather than components of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏🏼

@jeremy jeremy added this to the 2.7.2 milestone Oct 20, 2021
@jeremy jeremy merged commit d8c6e5f into mikel:master Oct 20, 2021
@lewispb lewispb deleted the lb/handle-question-mark branch October 20, 2021 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants