Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17058

Special character issue in emails from PHP 8.0 and higher

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.3.9
    • 3.3.9-RC1
    • Template Engine
    • None

      With PHP 7.4 and lower this kind of Line endings works fine:
      \phpBB\includes\functions_messenger.php

       $encode_eol = ($config['smtp_delivery']) ? "\r\n" : PHP_EOL;
      

      Which leads to "\n" als $eol.

      From PHP 8.0 this needs to "\r\n" for e-mails or the headers will leads to problems with special characters like äöü or other UTF-8 characters.

      Suggested solution

      $encode_eol = $config['smtp_delivery'] || PHP_VERSION_ID >= 80000 ? "\r\n" : PHP_EOL;
      

            Crizzo Crizzo
            Crizzo Crizzo
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: