Skip to content
Snippets Groups Projects
Commit a28ee0cc authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

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

parent d662bd20
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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']);
......
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