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

A dot in email address leads to unwanted extraneous dot

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.1.4-RC1
    • Component/s: Posting
    • Labels:
      None

      Description

      Hello,

      Try a post with the text below on phpbb.com:
      John Doe [ john.doe@example.com ]

      The resulting post will have:
      John Doe [ john.doe@example.com. ]

      See the extraneous dot after the "com"

        Activity

        Hide
        aleha aleha added a comment -

        The error occurs when the username in the email contains a dot.
        One way to fix this for good, is by replacing the email regexp with the one that PHP uses, but it is a big line.

        The phpBB email regexp: https://github.com/phpbb/phpbb/blob/develop/phpBB/includes/functions.php#L3301-L3304

        The PHP email regex: http://lxr.php.net/xref/PHP_5_4/ext/filter/logical_filters.c#529

        Show
        aleha aleha added a comment - The error occurs when the username in the email contains a dot. One way to fix this for good, is by replacing the email regexp with the one that PHP uses, but it is a big line. The phpBB email regexp: https://github.com/phpbb/phpbb/blob/develop/phpBB/includes/functions.php#L3301-L3304 The PHP email regex: http://lxr.php.net/xref/PHP_5_4/ext/filter/logical_filters.c#529
        Hide
        rxu Ruslan Uzdenov added a comment - - edited

        This can be fixed in different ways. While the regex from PHP source pointed by aleha can be applied, this seems to be a major change (probably for 3.2+ ?), the existing regex can be adjusted.
        Currently the first capturing group matches only those parts of localpart with trailing dots if any. The secong group of localpart is non-capturing. Thus, if the localpart consists of several dot-separated parts, only those parts with trailing dots will be matching, which looks pointless for me. We could make the first capturing group matching the whole localpart instead (which is probably was the intention?).

        Show
        rxu Ruslan Uzdenov added a comment - - edited This can be fixed in different ways. While the regex from PHP source pointed by aleha can be applied, this seems to be a major change (probably for 3.2+ ?), the existing regex can be adjusted. Currently the first capturing group matches only those parts of localpart with trailing dots if any. The secong group of localpart is non-capturing. Thus, if the localpart consists of several dot-separated parts, only those parts with trailing dots will be matching, which looks pointless for me. We could make the first capturing group matching the whole localpart instead (which is probably was the intention?).

          People

          • Assignee:
            Marc Marc
            Reporter:
            spider2012 spider2012
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development