Jesse Morgan 2 years ago
committed by GitHub
parent
commit
85ed771870
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/helpers.php

+ 2
- 2
lib/helpers.php View File

@ -120,8 +120,8 @@ function micropub_media_post_for_user(&$user, $file) {
$r = micropub_post($user->micropub_media_endpoint, [], $user->micropub_access_token, $file, true, 'file'); $r = micropub_post($user->micropub_media_endpoint, [], $user->micropub_access_token, $file, true, 'file');
// Check the response and look for a "Location" header containing the URL // Check the response and look for a "Location" header containing the URL
if($r['response'] && preg_match('/Location: (.+)/', $r['response'], $match)) {
$r['location'] = trim($match[1]);
if($r['headers'] && $r['headers']['Location']) {
$r['location'] = $r['headers']['Location'];
} else { } else {
$r['location'] = false; $r['location'] = false;
} }

Loading…
Cancel
Save