Skip to content
This repository was archived by the owner on Jan 4, 2020. It is now read-only.

Commit cdbeadb

Browse files
committed
修正Db类
2 parents 8928c45 + e700561 commit cdbeadb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ThinkPHP/Library/Think/Db.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private static function parseDsn($dsnStr)
125125
'password' => isset($info['pass']) ? $info['pass'] : '',
126126
'hostname' => isset($info['host']) ? $info['host'] : '',
127127
'hostport' => isset($info['port']) ? $info['port'] : '',
128-
'database' => isset($info['path']) ? substr($info['path'], 1) : '',
128+
'database' => isset($info['path']) ? ltrim($info['path'], '/') : '',
129129
'charset' => isset($info['fragment']) ? $info['fragment'] : 'utf8',
130130
);
131131

0 commit comments

Comments
 (0)