summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/pdo_driver.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-02-12 12:15:41 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-02-12 12:15:41 +0100
commitde7da338e21885b9ecc4f5a64ba77ee8475960d2 (patch)
treebe5eddd607b09bef39e221478da73a81cdf9ad07 /system/database/drivers/pdo/pdo_driver.php
parent16af6afe991381360439135ddb0735dab1280fed (diff)
parent7d7b304bd98b310957d5077048899ea6e908583a (diff)
Merge pull request #1026 from timw4mail/develop
Fixed old-style pdo connection string
Diffstat (limited to 'system/database/drivers/pdo/pdo_driver.php')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index fc378daeb..e84c1aaaf 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -117,7 +117,11 @@ class CI_DB_pdo_driver extends CI_DB {
// $db['hostname'] = 'pdodriver:host(/Server(/DSN))=hostname(/DSN);';
// We need to get the prefix (pdodriver used by PDO).
$this->dsn = $this->hostname;
- $this->pdodriver = substr($this->hostname, 0, strpos($this->hostname, ':'));
+ $split_dsn = explode(':', $this->hostname);
+ $this->pdodriver = $split_dsn[0];
+
+ // End this part of the dsn with a semicolon
+ $this->dsn .= rtrim(';', $this->dsn) . ';';
}
else
{