Skip to content
Snippets Groups Projects
Commit 6da2beea authored by Andreas Fischer's avatar Andreas Fischer
Browse files

Inline $port expression, getting rid of $port variable.

parent 1b02991a
No related branches found
No related tags found
No related merge requests found
...@@ -65,7 +65,6 @@ class OC_DB { ...@@ -65,7 +65,6 @@ class OC_DB {
$type = OC_Config::getValue( "dbtype", "sqlite" ); $type = OC_Config::getValue( "dbtype", "sqlite" );
if(strpos($host, ':')) { if(strpos($host, ':')) {
list($host, $socket)=explode(':', $host, 2); list($host, $socket)=explode(':', $host, 2);
$port = ctype_digit($socket) && $socket<=65535;
} else { } else {
$socket=FALSE; $socket=FALSE;
} }
...@@ -90,7 +89,7 @@ class OC_DB { ...@@ -90,7 +89,7 @@ class OC_DB {
'dbname' => $name, 'dbname' => $name,
); );
if ($socket) { if ($socket) {
if ($port) { if (ctype_digit($socket) && $socket <= 65535) {
$connectionParams['port'] = $socket; $connectionParams['port'] = $socket;
} else { } else {
$connectionParams['unix_socket'] = $socket; $connectionParams['unix_socket'] = $socket;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment