diff --git a/lib/helpers.php b/lib/helpers.php index 2102ee1..f325a81 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -126,6 +126,9 @@ function micropub_media_post_for_user(&$user, $file) { $r['location'] = false; } + $parts = explode("\r\n\r\n", $r['response']); + $r['body'] = isset($parts[2]) ? $parts[2] : null; + return $r; } @@ -447,6 +450,10 @@ function validate_photo(&$file) { } } +function tz_seconds_to_offset($seconds) { + return ($seconds < 0 ? '-' : '+') . sprintf('%02d:%02d', abs($seconds/60/60), ($seconds/60)%60); +} + // Reads the exif rotation data and actually rotates the photo. // Only does anything if the exif library is loaded, otherwise is a noop. function correct_photo_rotation($filename) {