Wiki source for NonWikiUserNames

Show raw source

There have been fragments on the discussion on the SuggestionBox for 'a while' now. I say fragments because there never seemed to be any resolution. So here's my little scratch in the dirt to mod the Wikka to do so.

It seems to be based upon the function ""IsWikiName()"" in /wikka.php, which is in turn referred to by
~-usersettings.php: for login and changepassword.
~-emailpassword.php: which just does a basic check and doesn't seem to be crucial for anything other than making sure it's a wikiname.

Before doing this or any other modification, back your shit up. A no brainer, but I thought i'd say it anyway.

FIND //(unmodified: line 666)//
%%(php;666)function IsWikiName($text) { return preg_match("/^[A-Z,ÄÖÜ][a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/", $text); }%%
%%(php;666)//MOD: nonwiki usernames : function IsWikiName($text) { return preg_match("/^[A-Z,ÄÖÜ][a-z,ßäöü]+[A-Z,0-9,ÄÖÜ][A-Z,a-z,0-9,ÄÖÜ,ßäöü]*$/", $text); }
function IsWikiName($text) { return preg_match("/^[A-Za-z0-9ÄÖÜäöü]*$/", $text); }%%

~&While we're at it - fix the regular expression: the commas don't belong in there! (Unless you want to allow a comma as part of a username, even at the start - probably not!) This is an old bug, actually, only partly fixed in version So the new function should be: %%(php;667)function IsWikiName($text) { return preg_match("/^[A-Za-z0-9ÄÖÜßäöü]*$/", $text); }%% Of course the RE can be further refined (making a difference between starting character and following characters, since for instance ß can never occor at the start of a word - but you get the idea. --JavaWoman
~~&You're too fast for me! i wasn't even done putzin with it (= it still remains untested, (working other stuff in) but will update when completed.

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki