From 2e4e7befe5a50885f8b01b472b1a45112812af98 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 29 Nov 2022 19:32:19 -0500 Subject: [PATCH] [various] Address a couple of PHP 8.1 notices - Replace a couple of strstr calls by strpos - Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1331012289 --- dwpost/dwpost.php | 2 +- statusnet/statusnet.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 5a7e6ba4..bfcc504d 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -126,7 +126,7 @@ function dwpost_send(App $a, array &$b) return; } - if (!strstr($b['postopts'],'dwpost')) { + if (strpos($b['postopts'] ?? '', 'dwpost') === false) { return; } diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 9e009d1b..5cb65b91 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -366,7 +366,7 @@ function statusnet_hook_fork(App $a, array &$b) } } else { // Comments are never exported when we don't import the GNU Social timeline - if (!strstr($post['postopts'], 'statusnet') || ($post['parent'] != $post['id']) || $post['private']) { + if (strpos($post['postopts'] ?? '', 'statusnet') === false || ($post['parent'] != $post['id']) || $post['private']) { $b['execute'] = false; return; }