File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,15 @@ public function parseConfiguration($config)
39
39
return $ config ;
40
40
}
41
41
42
- $ parsedUrl = $ this ->parseUrl ($ url );
42
+ $ rawComponents = $ this ->parseUrl ($ url );
43
+ $ decodedComponents = $ this ->parseStringsToNativeTypes (
44
+ array_map ('rawurldecode ' , $ rawComponents )
45
+ );
43
46
44
47
return array_merge (
45
48
$ config ,
46
- $ this ->getPrimaryOptions ($ parsedUrl ),
47
- $ this ->getQueryOptions ($ parsedUrl )
49
+ $ this ->getPrimaryOptions ($ decodedComponents ),
50
+ $ this ->getQueryOptions ($ rawComponents )
48
51
);
49
52
}
50
53
@@ -137,9 +140,7 @@ protected function parseUrl($url)
137
140
throw new InvalidArgumentException ('The database configuration URL is malformed. ' );
138
141
}
139
142
140
- return $ this ->parseStringsToNativeTypes (
141
- array_map ('rawurldecode ' , $ parsedUrl )
142
- );
143
+ return $ parsedUrl ;
143
144
}
144
145
145
146
/**
Original file line number Diff line number Diff line change @@ -174,6 +174,17 @@ public function databaseUrls()
174
174
'driver ' => 'mysql ' ,
175
175
],
176
176
],
177
+ 'simple URL with percent encoding in query ' => [
178
+ 'mysql://foo:bar%25bar@localhost/baz?timezone=%2B00%3A00 ' ,
179
+ [
180
+ 'username ' => 'foo ' ,
181
+ 'password ' => 'bar%bar ' ,
182
+ 'host ' => 'localhost ' ,
183
+ 'database ' => 'baz ' ,
184
+ 'driver ' => 'mysql ' ,
185
+ 'timezone ' => '+00:00 ' ,
186
+ ],
187
+ ],
177
188
'URL with mssql alias driver ' => [
178
189
'mssql://null ' ,
179
190
[
You can’t perform that action at this time.
0 commit comments