Skip to content

Commit 1f11300

Browse files
committed
Uses the realpath() to connect to databases
1 parent acd4732 commit 1f11300

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/JSONDB/JSONDB.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ public function connect($server, $username, $password, $database = NULL)
370370
{
371371
$this->benchmark->mark('jsondb_(connect)_start');
372372
$config = $this->config->getConfig('users');
373+
$server = realpath($server);
373374

374375
if (!array_key_exists($server, $config)) {
375376
$this->benchmark->mark('jsondb_(connect)_end');
@@ -381,8 +382,6 @@ public function connect($server, $username, $password, $database = NULL)
381382
throw new Exception("JSONDB Error: User's authentication failed for user \"{$username}\" on server \"{$server}\". Access denied.");
382383
}
383384

384-
$this->config->addUser($server, $username, $password);
385-
386385
$this->server = $server;
387386
$this->database = $database;
388387
$this->username = $username;

0 commit comments

Comments
 (0)