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

SQL error when saving profile with empty custom field of type "Numbers"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.3.1
    • 3.3.3-RC1
    • None
    • PHP 7.4.3, MariaDB 10.3.22, Ubuntu 20.04.1

    Description

      Saving a profile with an empty custom profile field of type "Numbers" (int) shows this error:

      Incorrect integer value: '' for column `phpBB`.`phpbb_profile_fields_data`.`pf_fieldname` at row 1 [1366]

      This is because manager.php overwrites the NULL value set by type_int.php with an empty string. Suggest this code change to check for string type first:

                              /**
                               * Replace Emoji and other 4bit UTF-8 chars not allowed by MySQL
                               * with their Numeric Character Reference's Hexadecimal notation.
                               */
                              if (is_string($cp_data['pf_' . $row['field_ident']]))
                              {
                                      $cp_data['pf_' . $row['field_ident']] = utf8_encode_ucr($cp_data['pf_' . $row['field_ident']]);
                              }
      

      Attachments

        Issue Links

          Activity

            People

              Marc Marc
              tbehrens tbehrens [X] (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: