Skip to content

Commit 3cb450e

Browse files
authored
defensive code in GU filter plugin (#80)
1 parent 475e3e6 commit 3cb450e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

content/plugins/f-gu-filter/plugin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111

1212
function rewrite_gu_response($response)
1313
{
14+
if (!is_array($response)) {
15+
return $response;
16+
}
17+
1418
$download_link = $response['download_link'] ?? null;
1519

16-
if (!$download_link || !str_contains($download_link, 'fairpm/fair-plugin')) {
20+
if (!$download_link || !is_string($download_link) || !str_contains($download_link, 'fairpm/fair-plugin')) {
1721
return $response;
1822
}
1923

0 commit comments

Comments
 (0)