File tree 2 files changed +19
-11
lines changed
2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,13 @@ public static function parseUrl(string $url):array|null{
173
173
return null ;
174
174
}
175
175
176
- return array_map ('urldecode ' , $ result );
176
+ $ parsed = array_map ('urldecode ' , $ result );
177
+
178
+ if (isset ($ parsed ['port ' ])){
179
+ $ parsed ['port ' ] = (int )$ parsed ['port ' ];
180
+ }
181
+
182
+ return $ parsed ;
177
183
}
178
184
179
185
}
Original file line number Diff line number Diff line change @@ -134,18 +134,20 @@ public static function parseUrlProvider():array{
134
134
return [
135
135
['http:// ' , null ],
136
136
[
137
- 'https://яндекAс.рф ' , [
138
- 'scheme ' => 'https ' ,
139
- 'host ' => 'яндекAс.рф ' ,
140
- ],
137
+ 'https://яндекAс.рф ' ,
138
+ [
139
+ 'scheme ' => 'https ' ,
140
+ 'host ' => 'яндекAс.рф ' ,
141
+ ],
141
142
],
142
143
[
143
- 'http://[2a00:f48:1008::212:183:10]:56?foo=bar ' , [
144
- 'scheme ' => 'http ' ,
145
- 'host ' => '[2a00:f48:1008::212:183:10] ' ,
146
- 'port ' => '56 ' ,
147
- 'query ' => 'foo=bar ' ,
148
- ],
144
+ 'http://[2a00:f48:1008::212:183:10]:56?foo=bar ' ,
145
+ [
146
+ 'scheme ' => 'http ' ,
147
+ 'host ' => '[2a00:f48:1008::212:183:10] ' ,
148
+ 'port ' => 56 ,
149
+ 'query ' => 'foo=bar ' ,
150
+ ],
149
151
],
150
152
];
151
153
}
You can’t perform that action at this time.
0 commit comments