1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

MySQL server compatibility fix.

This commit is contained in:
Cameron
2017-04-28 11:07:37 -07:00
parent 33fa33781d
commit 61e4582b85

View File

@@ -189,14 +189,14 @@ class e_db_mysql
if($this->pdo)
{
if(strpos($mySQLserver,':')!==false)
if(strpos($mySQLserver,':')!==false && substr_count($mySQLserver, ':')===1)
{
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
}
if($this->mySQLserver === 'localhost')
// if($this->mySQLserver === 'localhost') // problematic.
{
$this->mySQLserver = '127.0.0.1'; // faster by almost 1 second
// $this->mySQLserver = '127.0.0.1'; // faster by almost 1 second
}
try
@@ -285,14 +285,14 @@ class e_db_mysql
$this->mySQLpassword = $mySQLpassword;
$this->mySQLerror = false;
if(strpos($mySQLserver,':')!==false)
if(strpos($mySQLserver,':')!==false && substr_count($mySQLserver, ':')===1)
{
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
}
if($this->mySQLserver === 'localhost')
// if($this->mySQLserver === 'localhost') // problematic.
{
$this->mySQLserver = '127.0.0.1'; // faster by almost 1 second.
// $this->mySQLserver = '127.0.0.1'; // faster by almost 1 second.
}