Deprecation with PHP 8:

realpath(): Passing null to parameter #1 ($path) of type string is deprecated in /var/www/html/sites/all/modules/contrib/htmlmail/htmlmail.tpl.php line 110

Comments

djdevin created an issue. See original summary.

djdevin’s picture

Status: Active » Needs review
StatusFileSize
new493 bytes
djdevin’s picture

StatusFileSize
new1.12 KB

Updated with another similar fix.

strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/sites/all/modules/contrib/htmlmail/htmlmail.mail.inc line 284

poker10’s picture

Patch #2 looks good, thanks! Probably the second change should be in a separate issue, or this should be retitled, but it also works.

colinstillwell’s picture

I ran an audit on the whole module and found two additional files which need patching, so have created a new version.

salvis’s picture

Thank you for the patches!

Why does $_SERVER['SERVER_SOFTWARE'] need to be cast to string?

Is this already fixed in the D8 version?

poker10’s picture

I think that there are cases where the $_SERVER['SERVER_SOFTWARE'] is not defined and the patch is trying to "fix" that by casting to a string. Proper fix should be isset (see for example here, where the similar fix was made in D7 core: #2356055: Notice in includes/mail.inc define). But as I have mentioned in #4, I am not entirely sure that the fix to $_SERVER['SERVER_SOFTWARE'] is in scope of this issue.

  • joseph.olstad committed 857da4cd on 7.x-2.x authored by djdevin
    Issue #3281253 by djdevin, colinstillwell, poker10: realpath(): Passing...
joseph.olstad’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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