This Forum loses caps in Usernames / phpBB Search is Useless

<<

JSLover

Posts: 130

Joined: Thu May 19, 2011 4:19 pm

Post Sat May 21, 2011 12:19 am

This Forum loses caps in Usernames / phpBB Search is Useless

This Forum loses caps in Usernames

    I probably should've replied to this post...

    ...but that was posted in the Personas forum, which don't seem appropriate.

    As you can see, my current Username is "jslover", all lowercase & ugly. I registered as "JSLover" & that's how it's displayed when I Login to AMO (not the forum).

    Steps to reproduce...

    • Register a Username "This Is An Example" on AMO.
    • Login to the forum, notice the correct capitalization on 1st Login
    • Logout
    • Login again, notice it forgot the correct capitalization
    ...I think that's all that required to show the bug. People in the member list with still-cased names apparently have never logged in twice.

    This needs to be fixed, so we can have correctly-cased names on the forum, but furthermore, AMO needs to Login with Usernames NOT E-mail addresses. E-mail addresses are for sending & receiving msgs, not for typing in every time you need to Login somewhere.
phpBB Search is Useless

    I love phpBB, but its Search is nearly useless, I found that thread above searching for "usernames", then once I saw the Subject of the thread it found, I searched for "user name" & ever-so-helpfully it told me...

    Useless Forum Search wrote:Information

      The following words in your search query were ignored because they are too common words: name user.
      You must specify at least one word to search for. Each word must consist of at least 3 characters and must not contain more than 14 characters excluding wildcards.

    ...it ignored all my search terms, then complains that I must specify at least one word to search for! pfft!...I specified 2 words & it chose to ignore BOTH of them. phpBB Search needs an OVERHAUL.
phpBB Default Language

    I also do not like the phpBB default language of "British English"...they don't even include "American English" by default, you have to install that. I would like this forum to at least install the "American English" (or "English (US)" or whatever they call it) language so I can select it in my profile...& perhaps even make it the default language.
<<

JSLover

Posts: 130

Joined: Thu May 19, 2011 4:19 pm

Post Tue Aug 23, 2011 4:19 am

Update!...with Fix: This Forum loses caps in Usernames

In another topic...

...Jorge-Villalobos filed a bug on this issue...

...& linked to where the source code of this issue might be...

...turns out this is the file with the problem...

...before it puts the Username (& E-mail) in the phpBB db...it runs a couple functions on it...sql_escape() & utf8_clean_string()...

    The Problem code - uses utf8_clean_string()
  Code:
// Check if they've changed their name or email on the AMO side.   If they have, update them in phpbb.
if (($row['username'] != $amouser['username']) || ($row['user_email'] != $amouser['email'])) {
   $sql =' UPDATE '.USERS_TABLE.'
         SET username="'.$db->sql_escape(utf8_clean_string($amouser['username'])).'"
         , user_email="'.$db->sql_escape(utf8_clean_string($amouser['email'])).'"
         WHERE user_id = "'.$db->sql_escape(utf8_clean_string($amouser['id'])).'"';
   $db->sql_query($sql);
}

...it seems a side-effect (or intended effect?) of "utf8_clean_string()" is it lowercases the string too (instead of just "utf8_clean"ing it, whatever that means).

The utf8_clean_string() function call needs removed...or replaced with a similar function, that will "utf8_clean_string" without also lowercasing it. The Username is already sql_escape()'d, so I wonder if any utf8_clean_string() is even necessary?...is the Username unsafe for insertion without utf8_clean_string()?...actually, these values are directly from the AMO db, so shouldn't they already be safe?

    The Fixed code - utf8_clean_string() removed
  Code:
// Check if they've changed their name or email on the AMO side.   If they have, update them in phpbb.
if (($row['username'] != $amouser['username']) || ($row['user_email'] != $amouser['email'])) {
   $sql =' UPDATE '.USERS_TABLE.'
         SET username="'.$db->sql_escape($amouser['username']).'"
         , user_email="'.$db->sql_escape($amouser['email']).'"
         WHERE user_id = "'.$db->sql_escape($amouser['id']).'"';
   $db->sql_query($sql);
}

...there is one other utf8_clean_string() call in that file (not in the code above) & it should probably be removed too. It's used on $amouser['id'], which is already only a number, but leaving that one in at least won't cause this lowercase Username problem.
<<

archaeopteryx

AMO Editor

Posts: 1036

Joined: Fri Sep 25, 2009 1:38 pm

Location: Dresden, Germany

Post Wed Aug 24, 2011 11:23 am

Re: This Forum loses caps in Usernames / phpBB Search is Use

Please respond in the bug report (if you haven't done so yet).
<<

JSLover

Posts: 130

Joined: Thu May 19, 2011 4:19 pm

Post Wed Aug 24, 2011 11:38 am

Re: This Forum loses caps in Usernames

I don't have an account.
<<

archaeopteryx

AMO Editor

Posts: 1036

Joined: Fri Sep 25, 2009 1:38 pm

Location: Dresden, Germany

Post Wed Aug 24, 2011 12:19 pm

Re: This Forum loses caps in Usernames / phpBB Search is Use

Feel encouraged to signup.

Return to Forum Feedback and Support

Who is online

Users browsing this forum: No registered users

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
CA Gen2 style designed by Vjacheslav Trushkin.