]> git.mxchange.org Git - friendica-addons.git/commitdiff
[various] Address a couple of PHP 8.1 notices
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 30 Nov 2022 00:32:19 +0000 (19:32 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 30 Nov 2022 00:32:56 +0000 (19:32 -0500)
- Replace a couple of strstr calls by strpos
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1331012289

dwpost/dwpost.php
statusnet/statusnet.php

index 5a7e6ba4cfac29765c93aab018f3ae00fc783567..bfcc504da1670318b3f83822262e018f9d1e90bf 100644 (file)
@@ -126,7 +126,7 @@ function dwpost_send(App $a, array &$b)
                return;
        }
 
-       if (!strstr($b['postopts'],'dwpost')) {
+       if (strpos($b['postopts'] ?? '', 'dwpost') === false) {
                return;
        }
 
index 9e009d1b34ff5cc2444cf4e58f9f5a8ec15f50e1..5cb65b91fdb90d4ebec3c975d4a001086cefe3b5 100644 (file)
@@ -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;
                }