Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-13223

Using get_username_string() for email template variables causes HTML markup in emails

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-RC6
    • Fix Version/s: 3.1.0
    • Component/s: Notification System
    • Labels:
      None

      Description

      Support topic: https://www.phpbb.com/community/viewtopic.php?f=466&t=2268416

      admin_activate_user.php notification type is assigning usernames to email template variables using user_loader->get_username() in 'no_profile' mode, which in its turn calls get_username_string() function in 'no_profile' mode. This causes HTML markup in emails for username colour, like

      <span class="username">XXXXXX</span>

        Activity

        Hide
        nickvergessen Joas Schilling added a comment -

        Should use username instead?

        Show
        nickvergessen Joas Schilling added a comment - Should use username instead?
        Hide
        rxu Ruslan Uzdenov added a comment -

        Yeah. Preparing PR right now.

        Show
        rxu Ruslan Uzdenov added a comment - Yeah. Preparing PR right now.
        Hide
        rxu Ruslan Uzdenov added a comment -

        Listed through notification types and it seems admin_activate_user.php is the only having this issue with emails.

        Show
        rxu Ruslan Uzdenov added a comment - Listed through notification types and it seems admin_activate_user.php is the only having this issue with emails.
        Hide
        nextgen Melvin García added a comment -

        @Ruelan Uzdenov, this same variable is 2 lines in that file.

        112 - $username = $this->user_loader->get_username($this->item_id, 'no_profile');
        131 - $username = $this->user_loader->get_username($this->item_id, 'no_profile');

        Show
        nextgen Melvin García added a comment - @Ruelan Uzdenov, this same variable is 2 lines in that file. 112 - $username = $this->user_loader->get_username($this->item_id, 'no_profile'); 131 - $username = $this->user_loader->get_username($this->item_id, 'no_profile');
        Hide
        rxu Ruslan Uzdenov added a comment - - edited

        @Melvin Garcia
        The problem is only the one in public function get_email_template_variables() which sends the value to email template
        Another one is in public function get_title() which is ok as it creates notification title for the board.

        Show
        rxu Ruslan Uzdenov added a comment - - edited @Melvin Garcia The problem is only the one in public function get_email_template_variables() which sends the value to email template Another one is in public function get_title() which is ok as it creates notification title for the board.
        Hide
        nextgen Melvin García added a comment -

        Ohhh, thanks

        Show
        nextgen Melvin García added a comment - Ohhh, thanks

          People

          • Assignee:
            naderman Nils Adermann
            Reporter:
            rxu Ruslan Uzdenov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development