Fixed bug #5630: Install tool removes dots from admin usernames
authorOliver Hader <oliver.hader@typo3.org>
Sun, 11 Jan 2009 15:04:09 +0000 (15:04 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 11 Jan 2009 15:04:09 +0000 (15:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@4687 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/mod/class.tx_install.php

index e1dd41e..3d5302c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-11  Oliver Hader  <oliver@typo3.org>
+
+       * Fixed bug #5630: Install tool removes dots from admin usernames (thanks to Stefano Kowalke)
+
 2009-01-11  Steffen Kamper  <info@sk-typo3.de> 
 
        * Fixed bug #9825: Copy / Cut icons don't respect t3skin: drag'n'drop in pagetree (credits to Susanne Moog)
index 36b5c2d..524aa8e 100755 (executable)
@@ -3787,8 +3787,7 @@ From sub-directory:
                                case 'adminUser':       // Create admin user
                                        if ($whichTables['be_users'])   {
                                                if (is_array($this->INSTALL['database_adminUser']))     {
-                                                       $username = ereg_replace('[^[:alnum:]_-]','',trim($this->INSTALL['database_adminUser']['username']));
-                                                       $username = str_replace(' ','_',$username);
+                                                       $username = preg_replace('/[^\da-z._-]/i', '', trim($this->INSTALL['database_adminUser']['username']));
                                                        $pass = trim($this->INSTALL['database_adminUser']['password']);
                                                        if ($username && $pass) {
                                                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'be_users', 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr($username, 'be_users'));