Browse Source

Adjust users of subscriptionIcon

rpm
J. King 3 years ago
parent
commit
76f1cc8e91
  1. 4
      lib/REST/Miniflux/V1.php
  2. 2
      lib/REST/TinyTinyRSS/Icon.php

4
lib/REST/Miniflux/V1.php

@ -814,12 +814,12 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler {
} catch (ExceptionInput $e) { } catch (ExceptionInput $e) {
return new ErrorResponse("404", 404); return new ErrorResponse("404", 404);
} }
if (!$icon['data']) { if (!$icon || !$icon['data']) {
return new ErrorResponse("404", 404); return new ErrorResponse("404", 404);
} }
return new Response([ return new Response([
'id' => $icon['id'], 'id' => $icon['id'],
'data' => ($icon['type'] ?? "application/octet-stream").";base64,".base64_encode($icon['data']), 'data' => ($icon['type'] ?: "application/octet-stream").";base64,".base64_encode($icon['data']),
'mime_type' => $icon['type'], 'mime_type' => $icon['type'],
]); ]);
} }

2
lib/REST/TinyTinyRSS/Icon.php

@ -31,7 +31,7 @@ class Icon extends \JKingWeb\Arsse\REST\AbstractHandler {
return new Response(404); return new Response(404);
} }
try { try {
$url = Arsse::$db->subscriptionIcon(Arsse::$user->id ?? null, (int) $match[1], false)['url']; $url = Arsse::$db->subscriptionIcon(Arsse::$user->id ?? null, (int) $match[1], false)['url'] ?? null;
if (!$url) { if (!$url) {
return new Response(404); return new Response(404);
} }

Loading…
Cancel
Save