Ideally I am in a position where I need to allow the '=' character in usernames.

Any ideas how I can achieve this, I've searched and cannot find any way of doing this without a small hack, which although not ideal, I'm going to have to go this route as it is a bit of a necessity for the project I have in mind!

I found this topic http://drupal.org/node/44586 which I think points me in the direction, but am firstly unsure if the same will apply to 4.7 (and where i find this code), secondly I'm no expert on regular expressions so am unsure what I need to change to just allow the '=' character, and thirdly want to just check that enabling this won't cause me other problems further down the line?

Anyone any ideas/comments? any help greatly appreciated!

Comments

StuartMackenzie’s picture

ok I think I figured out how!

If I change this line in user.module

  if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $name)) return t('The username contains an illegal character.'); 

to this

  if (ereg("[^\x80-\xF7 [:alnum:]@_.=-]", $name)) return t('The username contains an illegal character.'); 

it should work.....or thats the theory! I'll test it when I get home

is the '=' character likely to cause any big problems with the site, I presume being contained in a string I should be safe but am not a programmer so have no ideas, could this cause database problems or open me up to any security vunerabilities?

BuZZ the limey
www.weblimbo.net