Drupal allows spaces in user names, so no need to convert them to underscores. Especially for users with hyphenated or apostrophised names. You don't want "Susan Porter-Smith" to become "Susan_Porter-Smith", or "Jim O'Hara" to become "Jim_O'Hara".

Comments

dan3h’s picture

StatusFileSize
new671 bytes

Here's a patch for the very easy fix.

dan3h’s picture

StatusFileSize
new609 bytes

Here is one more patch just to tighten up the code a tiny bit: use the trim() function-- it does what the two preg_replace functions were doing, and is more readable.

dwightaspinwall’s picture

Status: Active » Needs review

Hey nice catch Dan, and thanks for the patch. Let's get this reviewed and I'll get it in. Going on vacation for a couple weeks, so it'll need to wait.

dwightaspinwall’s picture

Status: Needs review » Closed (fixed)

fixed in 6.x-1.3 and 7.x-1.0-beta6