mirror of
https://github.com/php/php-src.git
synced 2026-04-22 23:48:14 +02:00
Search for the '@' symbol in the DSN from the right instead of the left.
That will allow the password element to include a '@' symbol without confusing the DSN parser. Submitted by: Alex L <admin@networkessence.net>
This commit is contained in:
+2
-2
@@ -459,7 +459,7 @@ class DB
|
||||
|
||||
// Get (if found): username and password
|
||||
// $dsn => username:password@protocol+hostspec/database
|
||||
if (($at = strpos($dsn,'@')) !== false) {
|
||||
if (($at = strrpos($dsn,'@')) !== false) {
|
||||
$str = substr($dsn, 0, $at);
|
||||
$dsn = substr($dsn, $at + 1);
|
||||
if (($pos = strpos($str, ':')) !== false) {
|
||||
@@ -722,4 +722,4 @@ class DB_row
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user