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

String profile fields validation limits content to latin chars only

    Details

      Description

      If string profile field validation is set to any option excepting "Any chars", it is impossible to enter non-latin characters as it leads to error like

      The field “Location” has invalid characters, only alphanumeric characters are allowed.

      The problem is here: https://github.com/phpbb/phpbb/blob/develop-ascraeus/phpBB/phpbb/profilefields/type/type_string_common.php#L21-L25
      Those regexes allow latin chars only.

        Activity

        Hide
        rxu Ruslan Uzdenov added a comment - - edited

        "field_validation" has field length of 20 which is not enough to store unicode properties sequence like

        [\p{L}\p{N}_+. \-\[\]]+

        because for sql query string it turns into

        [\\p{L}\\p{N}_\\+\\. \\-\\[\\]]+

        which is 32 characters long.

        Show
        rxu Ruslan Uzdenov added a comment - - edited "field_validation" has field length of 20 which is not enough to store unicode properties sequence like [\p{L}\p{N}_+. \-\[\]]+ because for sql query string it turns into [\\p{L}\\p{N}_\\+\\. \\-\\[\\]]+ which is 32 characters long.
        Hide
        nickvergessen Joas Schilling added a comment -

        then add a migration to change it to 64 characters

        Show
        nickvergessen Joas Schilling added a comment - then add a migration to change it to 64 characters
        Hide
        rxu Ruslan Uzdenov added a comment -

        I've added a migration which changes it to 50 chars This should be enough probably?

        Show
        rxu Ruslan Uzdenov added a comment - I've added a migration which changes it to 50 chars This should be enough probably?

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            rxu Ruslan Uzdenov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development