Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10384

Recipient names become always "Array" in message feature.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.9, 1.9.5
    • Component/s: Messages
    • Labels:
      None
    • Environment:
      Multi-bytes character-set environment.

      Description

      function email_to_user() in lib/moodlelib.php

      for example, followings are header of received email.
      --------------------------
      (OK) To: ??? ??? <shirai.shirai@nifty.com>
      (NG) To: Array <shirai.shirai@nifty.com>
      --------------------------

      foreach ($mail->ReplyTo as $key => $rt) { //ReplyTo Names
      // $mail->ReplyTo[$key][1] = $textlib->convert($rt, 'utf-8', $mail->CharSet); : original
      $mail->ReplyTo[$key][1] = $textlib->convert($rt[1], 'utf-8', $mail->CharSet); : modified by shirai
      }
      $mail->Subject = $textlib->convert($mail->Subject, 'utf-8', $mail->CharSet); //Subject
      foreach ($mail->to as $key => $to) {
      // $mail->to[$key][1] = $textlib->convert($to, 'utf-8', $mail->CharSet); //To Names : original
      $mail->to[$key][1] = $textlib->convert($to[1], 'utf-8', $mail->CharSet); //To Names : modified by shirai
      }
      ------------------------------
      need to change convert($rt, ...) to convert($rt[1], ...) , convert($to, ...) to convert($to[1], ...).
      since $rt and $to are array. $to[0] is email address, $to[1] is full name of recipient

        Attachments

          Activity

            People

            Assignee:
            poltawski Dan Poltawski
            Reporter:
            shirai Tatsuya Shirai
            Tester:
            Petr Skoda Petr Skoda
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/May/09