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

Incorrect variable expansion in the message template

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.5.4, 2.6, 2.6.1
    • Fix Version/s: 2.5.5, 2.6.2
    • Component/s: Messages
    • Labels:
    • Testing Instructions:
      Hide

      (difficulty: easy, requires two users to exchange at least a private message)

      1. Send a PM from <user1> to <user2>;
      2. Check <user2> PMs and open the browser dev tools (<F12>): look at the message element to read, in the HTML source, the fixed named anchor, <a name="m<message_id>"></a>.
      Show
      (difficulty: easy, requires two users to exchange at least a private message) Send a PM from <user1> to <user2> ; Check <user2> PMs and open the browser dev tools ( <F12> ): look at the message element to read, in the HTML source, the fixed named anchor, <a name="m<message_id>"></a> .
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      m27_MDL-43577_Incorrect_Variable_Expansion

      Description

      While working on MDL-43571 I've found a trivial issue in the way the named anchor on top of each message has been created, see the HTML source:

      ...
      <a name="NNN"></a>
      <a name="m'.MMM.'"></a>
      <span class="message-meta"></span>
      ...
      

      This is due to an incorrect variable expansion in the code, kind of expecting an echo:

          return <<<TEMPLATE
      <div class='message $class'>
          <a name="m'.{$message->id}.'"></a>
          <span class="message-meta"><span class="time">$time</span></span>: <span class="text">$messagetext</span>
      </div>
      TEMPLATE;
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Mar/14