Browse Source
fix file handling for media endpoint
was broken in #82
pull/96/head
Aaron Parecki
7 years ago
No known key found for this signature in database
GPG Key ID: 276C2817346D6056
1 changed files with
3 additions and
5 deletions
-
controllers/micropub.php
|
@ -50,8 +50,7 @@ $app->post('/micropub/multipart', function() use($app) { |
|
|
unset($_POST['null']); |
|
|
unset($_POST['null']); |
|
|
|
|
|
|
|
|
if(!$error) { |
|
|
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); |
|
|
$r = micropub_post_for_user($user, $_POST, $file); |
|
|
} else { |
|
|
} else { |
|
|
$r = array('error' => $error); |
|
|
$r = array('error' => $error); |
|
@ -82,9 +81,8 @@ $app->post('/micropub/media', function() use($app) { |
|
|
unset($_POST['null']); |
|
|
unset($_POST['null']); |
|
|
|
|
|
|
|
|
if(!$error) { |
|
|
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 { |
|
|
} else { |
|
|
$r = array('error' => $error); |
|
|
$r = array('error' => $error); |
|
|
} |
|
|
} |
|
|