Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 10 years ago

#5093 closed enhancement (worksforme)

Leading whitespace in display names messes with alphabetical sort

Reported by: boonebgorges Owned by:
Priority: lowest Milestone:
Component: Core Version:
Severity: minor Keywords: needs-testing needs-patch
Cc: vivek@…

Description

If a username is entered as " Boone" rather than "Boone", it'll show up first in the list when doing an alphabetical sort. In my experience, a name is typically entered with leading whitespace by accident. But it could also be used as a sort of hack to get your profile to the top of the list. We might consider trimming this whitespace, either on the way in (at the time of profile save), or at the time of query:

ORDER BY LTRIM(u.value)

Are there legit reasons for wanting leading whitespace? Would the latter query cause performance issues at scale? Needs testing.

Change History (4)

#1 @sooskriszta
12 years ago

  • Cc vivek@… added

While I can imagine special characters such as the exclamation/bang/! as the genuine leading letter in a name, I can't think of any reasons why a leading space would be needed.

We should trim it on profile save.

#2 @boonebgorges
12 years ago

  • Keywords needs-patch added; has-patch removed

#3 @slaFFik
10 years ago

  • Milestone Future Release2.8

#4 @boonebgorges
10 years ago

  • Milestone 2.8
  • Resolutionworksforme
  • Status newclosed

On further testing, it appears that field data is, in fact, stripped on save. I can't see at a glance when this change took place, but the stack trace is:

Note: See TracTickets for help on using tickets.