Skip to content

Commit e75dd60

Browse files
committed
isset checks for URI components in Request constructor.
1 parent cbf8db4 commit e75dd60

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Darya/Http/Request.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ public function __construct($uri, $method = 'get', $data = array()) {
138138
}
139139

140140
$components = parse_url($uri);
141-
$path = $components['path'] ?: '';
141+
$path = isset($components['path']) ? $components['path'] : '';
142142

143-
parse_str($components['query'], $get);
144-
$this->data['get'] = array_merge($this->data['get'], $get);
143+
if (isset($components['query'])) {
144+
parse_str($components['query'], $get);
145+
$this->data['get'] = array_merge($this->data['get'], $get);
146+
}
145147

146148
$this->uri = $uri;
147149
$this->path = $path;

0 commit comments

Comments
 (0)