Skip to:

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7671 closed defect (bug) (fixed)

Bypass required "name" field on user registration

Reported by: djpaul's profile DJPaul Owned by: djpaul's profile djpaul
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Registration Keywords:



Entering three spaces into the default "Name" profile field seems to be treated as valid, and allows the user registration go two through. I've tested this on Nouveau on a recent 3.0-trunk, so we need to check what's going on.

Attachments (1)

7671.01.patch (821 bytes) - added by DJPaul 5 years ago.

Download all attachments as: .zip

Change History (9)

#1 @hnla
5 years ago

I checked again and it does, maybe I misunderstood and checked username originally.

I've lost track of why we force the 'name' field as if empty we just display username, after all 'name' is the WP display name and not a required field really.

We'll have to add a regex check that the input isn't simply white space but as one or more characters.

5 years ago

#2 @DJPaul
5 years ago

Can anyone think of any problems of running trim() on all profile field values submitted during user registration?

#3 @DJPaul
5 years ago

  • Milestone changed from Awaiting Review to Under Consideration

e.g. 7671.01.patch.

#4 @hnla
5 years ago

That would empty the value I guess but have we run that after or before validation of any description, obviously html 'required' see it as having a value so passes.

Why do we require this, I remember a lot of time spent on usernames but that was at least four years back so fuzzy memory.

BTW this is one of the fields that prompted my concern over lack of 'required' attr on xprofile required fields.

#5 @hnla
5 years ago

Tested that change and it works for me, throws me back to the input with error message.

#6 @hnla
5 years ago

  • Milestone changed from Under Consideration to 3.0

Been trying to imagine a scenario where an input with - in our context - white space before and after would be valid, but can't so think trim is a good way of dealing with values returned with just white space.

I would set as 'commit' but you may want further opinions.

#7 @djpaul
5 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 11831:

Members, registration: trim whitespace around field values before processing.

Prevents whitespace causing required fields to be skipped on the user registration form.

Fixes #7671

#8 @r-a-y
5 years ago

In 12150:

Registration: Trim POST fields for multi-select and checkbox options.

The change made in #7671 to trim registration POST fields broke profile
fields that contained multi-select or checkbox options. This is because
these fields use arrays. To address this, we now also trim array POST

See #7671.

Fixes #7845 (3.x branch).

Note: See TracTickets for help on using tickets.