From 004b216f7a5243c1d53048a477a23d68e9162fbc Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sun, 20 Aug 2017 08:35:10 -0700 Subject: [PATCH] fix file handling for media endpoint was broken in #82 --- controllers/micropub.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/controllers/micropub.php b/controllers/micropub.php index a1c3a26..a6ec9d5 100644 --- a/controllers/micropub.php +++ b/controllers/micropub.php @@ -50,8 +50,7 @@ $app->post('/micropub/multipart', function() use($app) { unset($_POST['null']); if(!$error) { - $file_path = $file['tmp_name']; - correct_photo_rotation($file_path); + correct_photo_rotation($file['tmp_name']); $r = micropub_post_for_user($user, $_POST, $file); } else { $r = array('error' => $error); @@ -82,9 +81,8 @@ $app->post('/micropub/media', function() use($app) { unset($_POST['null']); if(!$error) { - $file_path = $file['tmp_name']; - correct_photo_rotation($file_path); - $r = micropub_media_post_for_user($user, $file_path); + correct_photo_rotation($file['tmp_name']); + $r = micropub_media_post_for_user($user, $file); } else { $r = array('error' => $error); }