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

Error: Call to undefined function get_magic_quotes_runtime() #27

Closed
bugfolder opened this issue Nov 28, 2023 · 9 comments · Fixed by #33
Closed

Error: Call to undefined function get_magic_quotes_runtime() #27

bugfolder opened this issue Nov 28, 2023 · 9 comments · Fixed by #33
Labels

Comments

@bugfolder
Copy link
Contributor

bugfolder commented Nov 28, 2023

This error started appearing my dblog:

Error: Call to undefined function get_magic_quotes_runtime() in PHPMailer->EncodeFile() (line 1445 of /mysite/modules/contrib/smtp/includes/smtp.phpmailer.inc).

That's a PHP function, but PHP says it's now removed in PHP 8.0+ (and I just upgraded the site from PHP 7.4 to 8.1).

Can we update this module for PHP 8.1 compatibility?

@indigoxela
Copy link
Member

Here's a PR to fix that.

@herbdool
Copy link
Contributor

Since backdrop supports from PHP 5.6 I think we might want to leave it in and add a check for less than 8.0 instead.

@indigoxela
Copy link
Member

indigoxela commented Feb 26, 2024

Since backdrop supports from PHP 5.6 I think we might want to leave it in...

Not necessarily. It's not only about get_magic_quotes_runtime(), which was deprecated in 7.4.0, and removed as of PHP 8.0. It's also about set_magic_quotes_runtime(), which was deprecated 5.3.0, and removed as of PHP 7.0.0.

And in general it's discouraged to rely on magic quotes.

In D7 this has been removed as well.

Seems like the ini directives for magic_quotes have been removed in PHP 5.4 or so, but I can't find an official document for that, as this is "dead" for so long now. 😉 This ini setting doesn't have any effect for a while.

@yorkshire-pudding
Copy link

I support removing these. Looking at the PR, removing these doesn't seem to stop any functionality, so even if someone on PHP 5.6 updates the SMTP module (very unlikely - look at telemetry for Backdrop and usage for Backdrop and SMTP), they will still be able to use the module.

FA: @jenlampton

@indigoxela
Copy link
Member

Given, that this PR is now several months old, this issue may qualify for @backdrop-contrib/bug-squad interaction? 😉

@herbdool
Copy link
Contributor

We need some testing before bug squad can do anything.

@yorkshire-pudding
Copy link

I'll do some testing with different versions of PHP tomorrow

@yorkshire-pudding
Copy link

@herbdool @indigoxela - I have tested this PR on PHP versions: 5.6, 7.4, 8.2 and 8.3
All with logs and messages set to max
All successfully sent the emails with nothing but a success message in the logs.

@herbdool
Copy link
Contributor

Thorough testing @yorkshire-pudding thanks! I think we can merge it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants