@@ -46,7 +46,10 @@ public static function resolve( $uri ) {
46
46
return new WP_Error (
47
47
'webfinger_missing_links ' ,
48
48
__ ( 'No valid Link elements found. ' , 'activitypub ' ),
49
- $ data
49
+ array (
50
+ 'status ' => 400 ,
51
+ 'data ' => $ data ,
52
+ )
50
53
);
51
54
}
52
55
@@ -65,7 +68,10 @@ public static function resolve( $uri ) {
65
68
return new WP_Error (
66
69
'webfinger_url_no_activitypub ' ,
67
70
__ ( 'The Site supports WebFinger but not ActivityPub ' , 'activitypub ' ),
68
- $ data
71
+ array (
72
+ 'status ' => 400 ,
73
+ 'data ' => $ data ,
74
+ )
69
75
);
70
76
}
71
77
@@ -103,7 +109,10 @@ public static function uri_to_acct( $uri ) {
103
109
return new WP_Error (
104
110
'webfinger_url_no_acct ' ,
105
111
__ ( 'No acct URI found. ' , 'activitypub ' ),
106
- $ data
112
+ array (
113
+ 'status ' => 400 ,
114
+ 'data ' => $ data ,
115
+ )
107
116
);
108
117
}
109
118
@@ -144,7 +153,14 @@ public static function get_identifier_and_host( $url ) {
144
153
}
145
154
146
155
if ( empty ( $ host ) ) {
147
- return new WP_Error ( 'webfinger_invalid_identifier ' , __ ( 'Invalid Identifier ' , 'activitypub ' ) );
156
+ return new WP_Error (
157
+ 'webfinger_invalid_identifier ' ,
158
+ __ ( 'Invalid Identifier ' , 'activitypub ' ),
159
+ array (
160
+ 'status ' => 400 ,
161
+ 'data ' => $ url ,
162
+ )
163
+ );
148
164
}
149
165
150
166
return array ( $ identifier , $ host );
@@ -187,7 +203,10 @@ public static function get_data( $uri ) {
187
203
return new WP_Error (
188
204
'webfinger_url_not_accessible ' ,
189
205
__ ( 'The WebFinger Resource is not accessible. ' , 'activitypub ' ),
190
- $ webfinger_url
206
+ array (
207
+ 'status ' => 400 ,
208
+ 'data ' => $ webfinger_url ,
209
+ )
191
210
);
192
211
}
193
212
@@ -215,7 +234,10 @@ public static function get_remote_follow_endpoint( $uri ) {
215
234
return new WP_Error (
216
235
'webfinger_missing_links ' ,
217
236
__ ( 'No valid Link elements found. ' , 'activitypub ' ),
218
- $ data
237
+ array (
238
+ 'status ' => 400 ,
239
+ 'data ' => $ data ,
240
+ )
219
241
);
220
242
}
221
243
@@ -228,7 +250,10 @@ public static function get_remote_follow_endpoint( $uri ) {
228
250
return new WP_Error (
229
251
'webfinger_missing_remote_follow_endpoint ' ,
230
252
__ ( 'No valid Remote-Follow endpoint found. ' , 'activitypub ' ),
231
- $ data
253
+ array (
254
+ 'status ' => 400 ,
255
+ 'data ' => $ data ,
256
+ )
232
257
);
233
258
}
234
259
0 commit comments