File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 33class Db_Activitypub_Followers {
44
55 public static function get_followers ( $ author_id ) {
6- return get_user_option ( 'activitypub_followers ' , $ author_id );
6+ $ followers = get_user_option ( 'activitypub_followers ' , $ author_id );
7+
8+ if ( ! $ followers ) {
9+ return $ followers ;
10+ }
11+
12+ if ( count ( $ array ) == count ( $ array , COUNT_RECURSIVE ) ) {
13+ return $ followers ;
14+ }
15+
16+ foreach ( $ followers as $ key => $ follower ) {
17+ if (
18+ is_array ( $ follower ) &&
19+ isset ( $ follower ['type ' ] ) &&
20+ 'Person ' === $ follower ['type ' ] &&
21+ isset ( $ follower ['id ' ] ) &&
22+ true === filter_var ( $ follower ['id ' ], FILTER_VALIDATE_URL )
23+ ) {
24+ unset( $ followers [$ key ] );
25+ $ followers [] = $ follower ['id ' ];
26+ }
27+ }
28+
29+ return $ followers ;
730 }
831
932 public static function add_follower ( $ actor , $ author_id ) {
You can’t perform that action at this time.
0 commit comments