From: Jon Parise Date: Thu, 4 Oct 2001 00:29:37 +0000 (+0000) Subject: Search for the '@' symbol in the DSN from the right instead of the left. X-Git-Tag: PRE_PARAMETER_PARSING_API~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6bed4ce3d194563919e21a4677ce6aacd7e39ea;p=php 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 --- 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 +?>