From c6bed4ce3d194563919e21a4677ce6aacd7e39ea Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Thu, 4 Oct 2001 00:29:37 +0000 Subject: [PATCH] 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 --- pear/DB.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pear/DB.php b/pear/DB.php index 1710f3997f..e0e4789bf9 100644 --- a/pear/DB.php +++ b/pear/DB.php @@ -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 } } -?> \ No newline at end of file +?> -- 2.50.1