summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2017-08-20 08:35:10 -0700
committerAaron Parecki <aaron@parecki.com>2017-08-20 08:35:10 -0700
commit004b216f7a5243c1d53048a477a23d68e9162fbc (patch)
treed4cb5214b3f5dd16fce4b94b80fc914aa9c92d6e
parentae4cbc49c4e6d25923a4e0a3242ea51f1695da22 (diff)
fix file handling for media endpoint
was broken in #82
-rw-r--r--controllers/micropub.php8
1 files 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);
}