Creating usernames with a 't' comes up as an invalid character.

ikogan - September 25, 2009 - 19:45
Project:HTPasswd Sync
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:m.fu
Status:closed
Description

Creating a new account and using a username with a 't' in the name returns "The username contains an illegal character, like , :." The regular expression test in _htpasswdsync_validate() on line 339 of htpasswdsync.module does not work. Instead of sing "\t", using [[:space:]] works for all whitespace. That makes the check simply [:[[:space:]]]:

333c333
<     if (ereg('[ :\t]', $edit['name'])) {
---
>     if (ereg('[:[[:space:]]]', $edit['name'])) {

Note: I have not tested this extensively but it *seems* to work.

#1

m.fu - October 16, 2009 - 16:43
Assigned to:Anonymous» m.fu

I am integrating the patch right now.
Please note the the correct regex is '[[:space:]]'
should be released shortly.
Thanks for the patch.

#2

m.fu - October 16, 2009 - 16:51
Status:active» fixed

fixed in v1.3

#3

ikogan - October 17, 2009 - 23:18

Thanks for integrating that fix. I didn't think that [[:space:]] includes colons, hence the [:[[:space:]]], so we get all manner of whitespace as well as colons.

#4

m.fu - October 19, 2009 - 04:54
Status:fixed» active

sorry you are right, I missed the colon. But the first regex did not match properly spaces. I'll see to correct that in the CVS version. Tell me if you need a release.

#5

m.fu - November 3, 2009 - 23:14
Status:active» fixed

CVS version is now released.

#6

System Message - November 17, 2009 - 23:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.