From 349f97a0813682f741b8f352cdd06eca9e027c33 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sun, 17 Aug 2025 01:56:31 +0000 Subject: [PATCH] add tz_seconds_to_offset function --- lib/helpers.php | 7 +++++++ 1 file changed, 7 insertions(+) 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) {