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

Fix email headers when using long email subjects and \r\n as crlf. #1709

Merged
merged 3 commits into from Oct 8, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/libraries/Email.php
Expand Up @@ -1228,7 +1228,7 @@ protected function _prep_q_encoding($str, $from = FALSE)

// wrap each line with the shebang, charset, and transfer encoding
// the preceding space on successive lines is required for header "folding"
return trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $output.$temp));
return trim(preg_replace('/^(.*?)(\n|\r)*$/m', ' =?'.$this->charset.'?Q?$1?=$2', $output.$temp));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why (.*?) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make (.*) non-greedy, and prevent it to capture \r

}

// --------------------------------------------------------------------
Expand Down