1
0
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:
Jon Parise
2001-10-04 00:29:37 +00:00
parent d452cf054e
commit c6bed4ce3d
+2 -2
View File
@@ -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
}
}
?>
?>