Role label validation does not support Unicode characters

$pattern = "'(\w+)\|(\w+)'";

should be

$pattern = "'(\pL+)\|(\pL+)'";

Comments

johnhanley’s picture

Assigned: Unassigned » johnhanley

Ah, good catch. I will role this into the next release. Thanks!

johnhanley’s picture

Status: Active » Fixed

This issue has been fixed and is part of the newest release. Thanks again for reporting it.

Status: Fixed » Closed (fixed)

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

lukebrenner’s picture

Version: 6.x-1.3 » 6.x-1.4
Status: Closed (fixed) » Needs work

That is very interesting !
I am getting the exact opposite result !
I'm using version 6.x-1.4 on a Drupal 6.14 installation and when I enable "Allow user-selectable roles" I am getting this error :

warning: preg_match() [function.preg-match]: Compilation failed: support for \P, \p, and \X has not been compiled at offset 2 in /home/admin/strippers.ro/sites/all/modules/user_selectable_roles/user_selectable_roles.module on line 118.
Please enter lowercase singular/plural role labels delimited with a vertical bar (|).

If I go and change

$pattern = "'(\pL+)\|(\pL+)'";

to

$pattern = "'(\w+)\|(\w+)'";

on line 117 in user_selectable_roles.module, then it works with no errors.

Any ideas ?

johnhanley’s picture

What version of PHP are you using? Is this your own local server or a web host?

lukebrenner’s picture

Hi,
I am using PHP 5.2.6 and this is a VPS running Centos 5.3.

johnhanley’s picture

I did some quick research regarding the above error and apparently it can be caused when the PCRE (Perl Compatible Regular Expressions) library is not compiled to support certain patterns (as the error message indicates.) In other words this appears to be a server-specific issue.

lukebrenner’s picture

Well, I guess I just have to leave it the way it works for me then ;)

Thank you.

johnhanley’s picture

Status: Needs work » Closed (fixed)