Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ba0219e4
Commit
ba0219e4
authored
Jan 24, 2006
by
Dries Buytaert
Browse files
- Patch
#21719
by rkerr: made db passwords with special characters work.
parent
576399c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/database.mysql.inc
View file @
ba0219e4
...
...
@@ -32,6 +32,12 @@ function db_connect($url) {
$url
=
parse_url
(
$url
);
// Decode url-encoded information in the db connection string
$url
[
'user'
]
=
urldecode
(
$url
[
'user'
]);
$url
[
'pass'
]
=
urldecode
(
$url
[
'pass'
]);
$url
[
'host'
]
=
urldecode
(
$url
[
'host'
]);
$url
[
'path'
]
=
urldecode
(
$url
[
'path'
]);
// Allow for non-standard MySQL port.
if
(
isset
(
$url
[
'port'
]))
{
$url
[
'host'
]
=
$url
[
'host'
]
.
':'
.
$url
[
'port'
];
...
...
includes/database.mysqli.inc
View file @
ba0219e4
...
...
@@ -32,6 +32,12 @@ function db_connect($url) {
$url
=
parse_url
(
$url
);
// Decode url-encoded information in the db connection string
$url
[
'user'
]
=
urldecode
(
$url
[
'user'
]);
$url
[
'pass'
]
=
urldecode
(
$url
[
'pass'
]);
$url
[
'host'
]
=
urldecode
(
$url
[
'host'
]);
$url
[
'path'
]
=
urldecode
(
$url
[
'path'
]);
// Allow for non-standard MySQL port.
if
(
isset
(
$url
[
'port'
]))
{
$url
[
'host'
]
=
$url
[
'host'
]
.
':'
.
$url
[
'port'
];
...
...
includes/database.pgsql.inc
View file @
ba0219e4
...
...
@@ -32,6 +32,12 @@ function db_connect($url) {
$url
=
parse_url
(
$url
);
// Decode url-encoded information in the db connection string
$url
[
'user'
]
=
urldecode
(
$url
[
'user'
]);
$url
[
'pass'
]
=
urldecode
(
$url
[
'pass'
]);
$url
[
'host'
]
=
urldecode
(
$url
[
'host'
]);
$url
[
'path'
]
=
urldecode
(
$url
[
'path'
]);
$conn_string
=
' user='
.
$url
[
'user'
]
.
' dbname='
.
substr
(
$url
[
'path'
],
1
)
.
' password='
.
$url
[
'pass'
]
.
' host='
.
$url
[
'host'
];
$conn_string
.
=
isset
(
$url
[
'port'
])
?
' port='
.
$url
[
'port'
]
:
''
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment