Remove code which contains deprecated function set_magic_quotes_runtime and ini directive 'magic_quotes_runtime'.
Version compare also corresponds to php 5.3 which is already past end of life. Can the part of the code be safely removed to do away with unwanted errors.

web/sites/all/modules/contrib/smtp/smtp.phpmailer.inc
-----------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------
 1448 | ERROR | Function set_magic_quotes_runtime() is deprecated since PHP 5.3 and removed since
      |       | PHP 7.0
 1451 | ERROR | INI directive 'magic_quotes_runtime' is deprecated since PHP 5.3 and removed since
      |       | PHP 5.4
 1458 | ERROR | Function set_magic_quotes_runtime() is deprecated since PHP 5.3 and removed since
      |       | PHP 7.0
 1461 | ERROR | INI directive 'magic_quotes_runtime' is deprecated since PHP 5.3 and removed since
      |       | PHP 5.4
-----------------------------------------------------------------------------------------------------

Comments

u_tiwari created an issue. See original summary.

u_tiwari’s picture

StatusFileSize
new1.19 KB

Please test this patch if as i found that control does not go inside the code which i have removed as get_magic_quotes_runtime() always returns false as of php 5.4

chris matthews’s picture

Version: 7.x-1.7 » 7.x-1.x-dev
solideogloria’s picture

Before this is committed, you need to make sure to set php = 5.4 in the smtp.info file, since that would be the new minimum PHP version supported by this module.

solideogloria’s picture

Status: Needs review » Needs work
Dru18’s picture

The source code itself is weird.
Both are deprecated since 5.3.0; why it tries to bring the ini_set('mgic_quotes_runtime..) back?

...
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
  set_magic_quotes_runtime(0);
}
else {
  ini_set('magic_quotes_runtime', 0);
}
...

I feel that else statement should go away.

solideogloria’s picture

@Dru18, you should take another look at the patch file. That's literally what the patch is for: to remove that code.

u_tiwari’s picture

Ok, is that change already covered in any other issue or should we add this via this issue and patch itself?

mohangathala’s picture

Assigned: Unassigned » mohangathala
mohangathala’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new1.06 MB

This patch #2 works for me. Screenshot attached for the same.

ravikk-drupal’s picture

Assigned: mohangathala » ravikk-drupal
StatusFileSize
new30.26 KB

This patch #2 works for me. Screenshot attached for the same.

ravikk-drupal’s picture

StatusFileSize
new30.26 KB

This patch #2 works for me. Screenshot attached for the same.

ravikk-drupal’s picture

damienmckenna’s picture

Assigned: ravikk-drupal » Unassigned
Parent issue: » #3093579: Plan for SMTP 7.x-1.8 release
krzysztof domański’s picture

Issue tags: +PHP 8.0

+1

alina.basarabeanu’s picture

Patch #2 works on Drupal core 7.91 and SMTP 7.x-1.7+21-dev version
Is there any chance to get a new stable release for Drupal 7?

alina.basarabeanu’s picture

Same as on the 3050130 issue, SMTP 7.x-1.8 release is out but this issue was not included.

damienmckenna’s picture

joseph.olstad’s picture

@japerry or any other maintainer for this project, please add PHP 8.0, PHP 8.1 and PHP 8.2 tests here:

https://www.drupal.org/node/35189/qa

joseph.olstad’s picture

patch 2 passes all automated tests with all major php versions including PHP 8.2

concensus is do it.

Pushing in now

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.