commit
ff71777ee6
|
@ -88,7 +88,7 @@ class DATABASE_CONFIG {
|
|||
public function __construct() {
|
||||
if (strpos(ZM_DB_HOST, ':')):
|
||||
$array = explode(':', ZM_DB_HOST, 2);
|
||||
if (is_numeric($array[1])):
|
||||
if (ctype_digit($array[1])):
|
||||
$this->default['host'] = $array[0];
|
||||
$this->default['port'] = $array[1];
|
||||
else:
|
||||
|
|
|
@ -33,7 +33,7 @@ function dbConnect()
|
|||
if (strpos(ZM_DB_HOST, ':')) {
|
||||
// Host variable may carry a port or socket.
|
||||
list($host, $portOrSocket) = explode(':', ZM_DB_HOST, 2);
|
||||
if (is_numeric($portOrSocket)) {
|
||||
if (ctype_digit($portOrSocket)) {
|
||||
$socket = ':host='.$host . ';port='.$portOrSocket;
|
||||
} else {
|
||||
$socket = ':unix_socket='.$portOrSocket;
|
||||
|
|
Loading…
Reference in New Issue