Bug #394

Naming an admin with special characters during installation doesn't "work"

Added by Michael Schlechtinger 7 months ago. Updated 4 months ago.

Status:Closed Start:08/20/2009
Priority:Normal Due date:
Assigned to:Tom Moore % Done:

100%

Category:Installation Procedure
Target version:1.4.10
Reproducibility:Always Browser:
Reported In MyBB Version:1.4.8 Database Type:
PHP Version: Database Version:

Description

I was setting up my new private forum for private use, and during the installation script it asked me for my admin account. I typed in "Fábio Maia" (my name). All working and stuff, but when the installation was complete and I acessed my forum my nickname was "F" ONLY. I tried to login with "Fábio Maia" and the respective password but it didn't work, now that I remember I could have tried to login with "F" and its password. Didn't really remember, so..

But then "eh, screw it. I'll just delete everything and install it again". So yeah I didn't make any specific tests. I could have tried to edit my admin account and tried to rename it to "Fábio Maia" again (but as I didn't remember to login as F, I couldn't login to the ACP as well).

I'm on a free-host running Windows and VistaPanel as the control panel, as I'm not going to spend money on a private forum just for a few couple of users. I didn't try this anymore, I have already a new board setup with no special chars. or spaces between words on my nickname. AND, in my new board I created a new user (not an admin) named "Fábio Maia" just to see if it was a global problem. It's not, seems like it just doesn't accept special chars. or spaces between words in the admin account during installation.

Any thoughts on this? :|

EDIT: Also, my board name was 8ºD and it showed up as 8D, not 8ºD. So I guess it's not just nicknames..
And still regarding the board name, I now also edited my forum name from 8D (which I set in the new installation, so the fact it's 8D doesn't mean it was a problem. I wrote 8D because I knew it wouldn't work) to 8ºD and it did make effect. I could edit the board name and got it working.

Associated revisions

Revision 4524
Added by Tom Moore 4 months ago

Fixes Naming an admin with special characters during installation doesn't "work" (fixes:394)

History

Updated by Tom Moore 4 months ago

I've been thinking this one over, and I'm going to recommend that this should be rejected as a bug - but with a suggestion for the installer. It can be reproduced, but only because the server (or in particular, PHP) hasn't been configured correctly. The culprit is php.ini's default_charset value.

On most shared servers (for example, on Hostgator), this value is left blank. The install script does not have a meta charset in the HTML output, so the script itself is literally relying on an ISO character set that doesn't have special characters - therefore cutting the username off at the character when inserting it into the database.

If PHP's default_charset is set to utf-8, then the installer will allow special characters in the username. This value can be set in .htaccess if the hosting company can't or won't let you manually change the ini settings.

My suggestion would be to have a meta charset output in the HTML for the installer based on what the user selects as their database encoding. Or php header it, either way should work OK (at least I think, I haven't tested).

Updated by Ryan Gordon 4 months ago

That sounds like a good solution. Using a PHP Header would be better I think

Updated by Tom Moore 4 months ago

It works either way but PHP's header is ideal. I guess the problem comes with the different character sets although in PHP6, PHP will automatically default to UTF-8.

I've tested this with the example in the description, chinese, cryllic and persian text, and it works fine. Adding just the utf-8 charset into PHP header allows special characters to be used. In ./install/output.php, in the print_header function and just before $this->doneheader = 1;:

@header("Content-type: text/html; charset=utf-8");

Is this a 1.6 and 1.4 fix?

Updated by Ryan Gordon 4 months ago

  • Status changed from New to Assigned
  • Assigned to set to Ryan Gordon
  • Target version set to 1.4.10

Yeh, I don't see how it can harm anything.

Updated by Ryan Gordon 4 months ago

  • Assigned to changed from Ryan Gordon to Tom Moore

Updated by Tom Moore 4 months ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4524.

Updated by Michael Schlechtinger 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF