Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I recognized a problem with sending content based mails from my own developed module. In the mimemail.inc (line 182):.
Error Message:
warning: realpath() expects parameter 1 to be a valid path, string given in C:\xampp\htdocs\eueco\sites\all\modules\mimemail\mimemail.inc on line 182.
$not_in_public_path = strpos(realpath($file), $public_path) === FALSE;
The line should be replaced with
if (@is_file($file)) $not_in_public_path = strpos(realpath($file), $public_path) === FALSE;
because if $content is filled really with $content, $file is equal to $content and this means, that $file is no path.
Comments
Comment #1
drewish CreditAttribution: drewish commentedSimilar issue in the 7.x branch that was fixed in the -dev release by #2366659: Attachments created using 'content' instead of 'file' generate warnings.
Comment #2
TR CreditAttribution: TR commentedD6 is long out of support - this should have been closed more than four years ago. As noted in #1, this has been fixed for D7.