Download & Extend

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

Project:HTPasswd Sync
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:m.fu
Status:closed (fixed)

Issue Summary

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.

Comments

#1

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

Status:active» fixed

fixed in v1.3

#3

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

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

Status:active» fixed

CVS version is now released.

#6

Status:fixed» closed (fixed)

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