Log in

View Full Version : Problem with username registration plugin


malmazan
11-15-2006, 10:15 AM
$this->fetch_field('username') = ucwords(strtolower($this->fetch_field('username')));

I made this plugin to capitalize all usernames to ensure consistency.

Though simple, i get errors ( i am very much a newbie).

errors:
Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \U, or \u at offset 3 in /includes/class_dm_user.php on line 399

Parse error: syntax error, unexpected '=' in /home/..../includes/class_dm_user.php(1556) : eval()'d code on line 1

I'd appreciate some help.

Actually i believe the

Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N, \U, or \u

error came from trying to restrict to unicode letter characters on the Admin CP Username regex

malmazan
11-20-2006, 03:22 PM
Any ideas as to where the error is coming from?

Parse error: syntax error, unexpected '=' in /home/..../includes/class_dm_user.php(1556) : eval()'d code on line 1

I change my code to $username = ucwords(strtolower($this->fetch_field('username')));

Now i do not get an error, but the line seems to have no effect on the username either.

That is using the userdata_presave hook

malmazan
11-22-2006, 11:26 AM
Man, is this driving me insane ...

Since the plugin was not working, i though i would try changing class_dm_user.php file instead.

So i replaced: So i replaced: $username = trim(preg_replace('#\s+#si', ' ', strip_blank_ascii($username, ' ')));


with $username = ucwords(strtolower(trim(preg_replace('#\s+#si', ' ', strip_blank_ascii($username, ' '))))); (ie. add ucwords(strtolower to teh existing line)
And still no results!!

Can anyone shed some light on this?

?I am begging you!