@@ -161,6 +161,10 @@ |
||
161 | 161 | return false; |
162 | 162 | } |
163 | 163 | |
164 | + /** |
|
165 | + * @param resource $stream |
|
166 | + * @param string $boundary |
|
167 | + */ |
|
164 | 168 | private function parseMultipartFormData($stream, $boundary) { |
165 | 169 | $post = ""; |
166 | 170 | $files = []; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $this->params[strtoupper($name)] = $value; |
51 | 51 | } |
52 | 52 | |
53 | - $this->stdin = $stdin; |
|
53 | + $this->stdin = $stdin; |
|
54 | 54 | |
55 | 55 | rewind($this->stdin); |
56 | 56 | } |
@@ -169,14 +169,14 @@ discard block |
||
169 | 169 | |
170 | 170 | while (!feof($stream)) { |
171 | 171 | $get_content = $field_name && !$in_header; |
172 | - $buffer = stream_get_line($stream, static::$buffer_size, "\r\n" . ($get_content ? '--'.$boundary : '')); |
|
172 | + $buffer = stream_get_line($stream, static::$buffer_size, "\r\n".($get_content ? '--'.$boundary : '')); |
|
173 | 173 | |
174 | 174 | if ($in_header && strlen($buffer) == 0) { |
175 | 175 | $in_header = false; |
176 | 176 | } else { |
177 | 177 | if ($get_content) { |
178 | 178 | if ($field_type === 'data') { |
179 | - $post .= (isset($post[0]) ? '&' : '') . $field_name . "=" . urlencode($buffer); |
|
179 | + $post .= (isset($post[0]) ? '&' : '').$field_name."=".urlencode($buffer); |
|
180 | 180 | } elseif ($field_type === 'file' && $filename) { |
181 | 181 | $tmp_path = $this->getUploadDir().'/'.substr(md5(rand().time()), 0, 16); |
182 | 182 | $err = file_put_contents($tmp_path, $buffer); |