Skip to content

Commit 111f52a

Browse files
committed
Ensure pathinfo is not passed empty strings
1 parent 6c84632 commit 111f52a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Wave/Http/Request.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ protected static function parseFormat($url, $default = null) {
199199
if(null === $default) {
200200
$default = PHP_SAPI === 'cli' ? 'cli' : Config::get('wave')->response->default_format;
201201
}
202-
$path = pathinfo($url);
202+
203+
$path = [];
204+
if (!empty($url)) {
205+
$path = pathinfo($url);
206+
}
203207

204208
return isset($path['extension']) ? $path['extension'] : $default;
205209
}

0 commit comments

Comments
 (0)