diff options
Diffstat (limited to 'phpBB/phpbb/db')
| -rw-r--r-- | phpBB/phpbb/db/driver/mysqli.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/db/migration/profilefield_base_migration.php | 3 | 
2 files changed, 7 insertions, 2 deletions
| diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 8fc306b2cc..2ed08211ad 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -61,7 +61,11 @@ class mysqli extends \phpbb\db\driver\mysql_base  		}  		$this->db_connect_id = mysqli_init(); -		@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS); + +		if (!@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS)) +		{ +			$this->db_connect_id = ''; +		}  		if ($this->db_connect_id && $this->dbname != '')  		{ diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 9cdd5d0927..d416a9b228 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -79,12 +79,13 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration  		$sql = 'SELECT lang_id  			FROM ' . LANG_TABLE;  		$result = $this->db->sql_query($sql); +		$lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name);  		while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))  		{  			$insert_buffer->insert(array(  				'field_id'				=> $field_id,  				'lang_id'				=> $lang_id, -				'lang_name'				=> strtoupper(substr($this->profilefield_name, 6)),// Remove phpbb_ from field name +				'lang_name'				=> $lang_name,  				'lang_explain'			=> '',  				'lang_default_value'	=> '',  			)); | 
