]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/HTTPInputData.php
Test file uploads
[friendica.git] / src / Util / HTTPInputData.php
index 8886b61e4c54ce236fee96bd50438906ba66c9d4..490dda5f66ab9756747ad3e6e736ca746faaf86f 100644 (file)
@@ -60,7 +60,7 @@ class HTTPInputData
                // can be handled by built in PHP functionality
                $content = static::getPhpInputContent();
 
-               $variables = json_decode($content);
+               $variables = json_decode($content, true);
 
                if (empty($variables)) {
                        parse_str($content, $variables);
@@ -135,13 +135,13 @@ class HTTPInputData
                        $files[$name] = self::fetchFileData($stream, $boundary, $headers, $filename);
                        return ['variables' => $variables, 'files' => $files];
                } else {
-                       $variables = self::fetchVariables($stream, $boundary, $name, $variables);
+                       $variables = self::fetchVariables($stream, $boundary, $headers, $name, $variables);
                }
 
                return ['variables' => $variables, 'files' => $files];
        }
 
-       private static function fetchFileData($stream, string $boundary, array $headers, string $filename)
+       protected static function fetchFileData($stream, string $boundary, array $headers, string $filename)
        {
                $error = UPLOAD_ERR_OK;
 
@@ -186,7 +186,7 @@ class HTTPInputData
                ];
        }
 
-       private static function fetchVariables($stream, string $boundary, string $name, array $variables)
+       private static function fetchVariables($stream, string $boundary, array $headers, string $name, array $variables)
        {
                $fullValue = '';
                $lastLine  = null;