@@ -151,6 +151,10 @@ |
||
| 151 | 151 | return $post ?: []; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | + /** |
|
| 155 | + * @param resource $stream |
|
| 156 | + * @param string $boundary |
|
| 157 | + */ |
|
| 154 | 158 | private function parseMultipartFormData($stream, $boundary) { |
| 155 | 159 | $post = ""; |
| 156 | 160 | $files = []; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->params[strtoupper($name)] = $value; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $this->stdin = $stdin; |
|
| 54 | + $this->stdin = $stdin; |
|
| 55 | 55 | |
| 56 | 56 | rewind($this->stdin); |
| 57 | 57 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | while (!feof($stream)) { |
| 161 | 161 | $getContent = $fieldName && !$inHeader; |
| 162 | - $buffer = stream_get_line($stream, static::$bufferSize, "\n" . ($getContent ? '--'.$boundary : '')); |
|
| 162 | + $buffer = stream_get_line($stream, static::$bufferSize, "\n".($getContent ? '--'.$boundary : '')); |
|
| 163 | 163 | $buffer = trim($buffer, "\r"); |
| 164 | 164 | |
| 165 | 165 | // Find the empty line between headers and body |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | if ($getContent) { |
| 173 | 173 | if ($fieldType === 'data') { |
| 174 | - $post .= (isset($post[0]) ? '&' : '') . $fieldName . "=" . urlencode($buffer); |
|
| 174 | + $post .= (isset($post[0]) ? '&' : '').$fieldName."=".urlencode($buffer); |
|
| 175 | 175 | } elseif ($fieldType === 'file' && $filename) { |
| 176 | 176 | $tmpPath = $this->getUploadDir().'/'.substr(md5(rand().time()), 0, 16); |
| 177 | 177 | $err = file_put_contents($tmpPath, $buffer); |