Logged in username contains illegal characters forbidden in this system

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

If you wish to attach one or more files enter the details below.

Expand view Topic review: Logged in username contains illegal characters forbidden in this system

Re: Logged in username contains illegal characters forbidden in this system

by pennymachines » Tue Jul 06, 2021 1:27 pm

I've successfully applied patch as described above. 8-)

Re: Logged in username contains illegal characters forbidden in this system

by pennymachines » Sat Jun 19, 2021 1:40 pm

Hi Alessio,
I'll await the update in case I mess something up.
Thanks!

Re: Logged in username contains illegal characters forbidden in this system

by axew3 » Fri Jun 18, 2021 8:31 pm

Hello David, ok going to check/fix asap, if in the while you like to change do it so, but a patch is coming

Re: Logged in username contains illegal characters forbidden in this system

by pennymachines » Fri Jun 18, 2021 6:42 pm

Hi!

I recently encountered this one on my multisite too - with spaces in usernames imported from phpBB.

Should I apply the fix above, or did you decide to do something in an update?

Cheers.

Re: Logged in username contains illegal characters forbidden in this system

by axew3 » Tue May 25, 2021 9:59 pm

As on my test, the username creating a site together with user account, only allow a-z 0-9 (if i'm not wrong)
and user containing space leading to a loop.
But as said i will return over to check again about this, if it is true or not because could be due to cookie wrongly set: the space char is not correctly encoded but maybe i'm totally out of the way, a check about this is required.

Re: Logged in username contains illegal characters forbidden in this system

by zpintar » Thu May 13, 2021 3:14 pm

Hmm, I'm not sure that I understood well.

This problem with characters "-,_, (space)" is caused by our WP Multisite? If it is an answer, that why MU has this limitation and pure WP do not?

BTW, when I try to create WP MU user with this characters in login name, I do not get any problems and the user is created with this characters. Why then your plugin makes problem with this?

Re: Logged in username contains illegal characters forbidden in this system

by axew3 » Thu May 13, 2021 1:20 pm

Well, i supposed it was a correct feature, but now i'm in doubt. If i do not wrongly remember, I've see (and read?) that my multisite was accepting usernames only as 0-9a-z-A-z but probably i'm wrong? It is only in the case that the user is also allowed to create a site, that was a multisite test where wp configured to allow this?

It could be also an option to be added, of course, if what i say just above is true: it depend by multisite config, if users allowed or not to create subsites. Maybe my deduction is totally wrong instead!?

Re: Logged in username contains illegal characters forbidden in this system

by zpintar » Thu May 13, 2021 7:40 am

OK, but do you planning add this modofications in future releases of plugin?

Is this a bug or feature? :)

Re: Logged in username contains illegal characters forbidden in this system

by axew3 » Thu May 13, 2021 7:01 am

About this, i was getting a loop in wp, which behavior i may will return over and fix, in the case that on multisite, users contains chars like spaces etc.
If you want to let wordpress to add any username, you could do this editing:

/wp-content/plugins/wp-w3all-phpbb-integration/class.wp.w3all-phpbb.php

where there are two lines like these:

Code: Select all

if( is_multisite() && !empty($phpbb_user_session) && preg_match('/[^0-9A-Za-z\p{Cyrillic}]/u',$phpbb_user_session[0]->username) ){
may search for

Code: Select all

if( is_multisite() && !empty($phpbb_user_session) && preg_match
will find two. Change into:

Code: Select all

if( is_multisite() && !empty($phpbb_user_session) && preg_match('/[^-0-9A-Za-z _.@\p{Cyrillic}]/u',$phpbb_user_session[0]->username) ){
note the regexp will accept default wp chars:

Code: Select all

^-0-9A-Za-z _.@
but note also as i commented at this time, little above this code:
// If it is a multisite, then Usernames can only contain lowercase letters (a-z) and numbers.
// Avoid any going on and setup as not linked this user (or get a loop)
then open wp_W3all file, you'll find 3 (beside some other commented):

Code: Select all

if ( is_multisite() && preg_match
change regexp of these with:

Code: Select all

[^-0-9A-Za-z _.@\p{Cyrillic}]
EDITED

Re: Logged in username contains illegal characters forbidden in this system

by zpintar » Wed May 12, 2021 11:37 am

My Wordpress is Multisite!

Logged in username contains illegal characters forbidden in this system

by zpintar » Wed May 12, 2021 10:14 am

I have a problem with phpBB usernames containing characters "-_ (space)".
If I have this allowed characters in phpBB usernames: -_ (space) I'm getting this error in Wordpress (and ca not login into WP)

Code: Select all

Notice: logged in username contains illegal characters forbidden in this system. Please contact an administrator.
Why this happened if characters like "-_ space" are allowed?

Of course, in WP I can create users with this characters (in phpBB too), but w3all throw this error in WP. Why?

Top