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

mail() PHP 7.1 compatibility - Escaped command exceeds the allowed length #68

Closed
adrianbj opened this issue Oct 31, 2016 · 4 comments
Closed

Comments

@adrianbj
Copy link

Short description of the issue

With php 7.1 you get that fatal error message because the $param variable is blank

Expected behavior

No error

Actual behavior

Fatal error message

Optional: Suggestion for a possible fix

So long as $param is not null it seems to work fine. I got this tip from this: PHPMailer/PHPMailer#861

I know you already check for null and set to an empty string, but perhaps 7.1 is for some reason considering '' as null in this case?

So long as $param contains something more than an empty string the error goes away.

Setup/Environment

  • ProcessWire version: 3.0.39
  • (Optional) PHP version: 7.1
@ryancramerdesign
Copy link
Member

Adrian, where are you seeing the error message? I'm guessing in the wire/core/WireMail.php file mail() command, but just wanted to double check that's what you are talking about?

@adrianbj
Copy link
Author

adrianbj commented Nov 1, 2016

Yes, exactly! Sorry for not being clear on that.

ryancramerdesign added a commit to processwire/processwire that referenced this issue Nov 1, 2016
@ryancramerdesign
Copy link
Member

Now that I think about it, all of our mail() have been converted to WireMail, so that's likely the only one there is in PW. Looking at the mail function docs on php.net, it seems like this is likely a bug in PHP 7.1, but it's easy enough to workaround–I've pushed an update that fixes it. Thanks.

@adrianbj
Copy link
Author

adrianbj commented Nov 1, 2016

Thanks - looks good!

foobarlab pushed a commit to foobarlab/processwire that referenced this issue Sep 15, 2017
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

No branches or pull requests

2 participants