Commit a28ee0cc authored by drumm's avatar drumm
Browse files

#81332 by wundo and davemicc. Allow empty MySQL passwords to work.

parent d662bd20
......@@ -56,7 +56,13 @@ function db_connect($url) {
// Decode url-encoded information in the db connection string
$url['user'] = urldecode($url['user']);
$url['pass'] = urldecode($url['pass']);
// Test if database url has a password.
if(isset($url['pass'])) {
$url['pass'] = urldecode($url['pass']);
}
else {
$url['pass'] = '';
}
$url['host'] = urldecode($url['host']);
$url['path'] = urldecode($url['path']);
......
......@@ -57,7 +57,13 @@ function db_connect($url) {
// Decode url-encoded information in the db connection string
$url['user'] = urldecode($url['user']);
$url['pass'] = urldecode($url['pass']);
// Test if database url has a password.
if(isset($url['pass'])) {
$url['pass'] = urldecode($url['pass']);
}
else {
$url['pass'] = '';
}
$url['host'] = urldecode($url['host']);
$url['path'] = urldecode($url['path']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment