-
Notifications
You must be signed in to change notification settings - Fork 197
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
Fixed "emails are displayed incorrectly" with PHP 8.1+ #344
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on PHP7.3 and PHP8, Linux.
I used DDEV and as PHP versions 7.4, 8 and 8.1. No issuess occurred. What was reported related to OpenMage is now resolved. |
Is this fixed in zendframework 2 and/or laminas the same way? |
i've no idea, I don't know much about those two |
those are both successors of zf1, so they might have fixed this too. this may safe change, i.e change for all users, could break some other agents: you probably should set the property yourself, as it's public property, |
since multiple people in #274 are facing this problem I think it should be fixed at a framework level anyway. |
There's also this: php/php-src#8086 |
I know nothing about Laminas, but the fix is about the same. First, the https://github.com/laminas/laminas-mail/blob/2.23.x/src/Headers.php#L51 Second, it is converted to https://github.com/laminas/laminas-mail/blob/2.23.x/src/Transport/Sendmail.php#L142-L147 This PR doesn't check for WIN OS and PHP ver. [edit] But when testing PHP 7.3 and 7.4 in Linux, the fix in this PR works. So, this PR seems good. |
this not a good excuse. because if this is a breaking change the rest of the users start to complain for whom it worked before. |
did you check php/php-src#8086? I see the worry about the possible BC, but not doing anything is BC for an opposite equal amount of people... |
would you like a PR which is more similar to laminas? |
@glensc - My personal opinion is that ZF1-Future must have the source code related to this issue similar to Laminas-Mail. It is obvious that this change is necessary, but the one in Laminas-Mail covers all the issues that could arise with its adoption. |
I've read along: mostly people are frustrated by the change, but PHP devs say \r\n is standards conformant. but really standards is for smtp saying must be \r\n terminated, no standard how one should talk to /usr/lib/sendmail. perhaps introduce similar behavior to: i.e respect not sure what is "similar to laminas", you just linked to a line. maybe commit or pull request making the change has more context? |
Most similar to laminas i mean the code posted by @kiatng obviously. I’m doing it if you’ll consider it, otherwise I’ll check other solutions internally, sorry but time is precious for everybody. |
phpmailer seems has taken totally different approach. tells to use smtp rather sendmail driver :) |
php |
Seems checking
See also:
|
@fballiano laminas way is the recommended solution, I said as first note here: likely battle-tested by them as the changes already seem 3yr old. but it may be more changes than just those lines printed here: |
I rewrote the PR, not sure about the $fromEmailHeader, which shouldn't contain an EOL anyway... |
What abuot EOL constant? in zf2/laminas it's there since 2012: Describe your changes and thinking logic in PR body. |
I see no other EOL constant in the Zend/Mail folder. |
I guess @glensc wants to use self::EOL instead of "\r\n", like here |
Indeed, somehow I looked only the new commit, and assumed it was force pushed, but the original commit is still here: |
I’d keep it this way in case somebody extends the class. I think it’s the same thought the laminas people did |
any news on the merge of this PR? |
@fballiano I'll review that in comming days, now focusing on the bugfix release. |
Checked all information presented, I think we are good to go here. |
This PR should fix issue #274 and issue OpenMage/magento-lts#3174 in OpenMage.
EDIT: this PR ports the fix used by laminas in https://github.com/laminas/laminas-mail/blob/2.23.x/src/Transport/Sendmail.php#L142-L147