Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

[mail] Fix set UTF-8 values to headers. Fix #7501 #7506

Merged
merged 7 commits into from
May 8, 2015
Merged

[mail] Fix set UTF-8 values to headers. Fix #7501 #7506

merged 7 commits into from
May 8, 2015

Conversation

Maks3w
Copy link
Member

@Maks3w Maks3w commented May 8, 2015

No description provided.

@Maks3w Maks3w changed the title [mail] Fix set UTF-8 values to headers [mail] Fix set UTF-8 values to headers. Fix #7501 May 8, 2015
@Maks3w Maks3w added the Mail label May 8, 2015
throw new Exception\InvalidArgumentException('Email must be a valid email address');
}

if (preg_match("/[\r|\n]/", $email)) {
Copy link
Member

Choose a reason for hiding this comment

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

You can remove the | character as this is a character class.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

$this->setEncoding('ASCII');
} else {
$this->setEncoding('UTF-8');
}
Copy link
Member

Choose a reason for hiding this comment

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

Let's make this a ternary:

$this->encoding = Mime::isPrintable($this->fieldValue) ? 'ASCII' : 'UTF-8';

$this->setEncoding('ASCII');
} else {
$this->setEncoding('UTF-8');
}
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above; make this a ternary.

weierophinney added a commit that referenced this pull request May 8, 2015
[mail] Fix set UTF-8 values to headers. Fix #7501
weierophinney added a commit that referenced this pull request May 8, 2015
[mail] Fix set UTF-8 values to headers. Fix #7501
weierophinney added a commit that referenced this pull request May 8, 2015
@weierophinney weierophinney merged commit 330a64c into zendframework:master May 8, 2015
weierophinney added a commit that referenced this pull request May 8, 2015
@weierophinney weierophinney added this to the 2.4.2 milestone May 8, 2015
@weierophinney weierophinney self-assigned this May 8, 2015
@Maks3w Maks3w deleted the hotfix/mail-utf8 branch May 9, 2015 11:10
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy