Browse Source

fix file handling for media endpoint

was broken in #82
pull/96/head
Aaron Parecki 7 years ago
parent
commit
004b216f7a
No known key found for this signature in database GPG Key ID: 276C2817346D6056
  1. 8
      controllers/micropub.php

8
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);
}

Loading…
Cancel
Save