mirror of
https://github.com/Automattic/wordpress-activitypub
synced 2024-10-18 14:23:31 +00:00
throw error if url is empty
This commit is contained in:
parent
4397ae95c8
commit
b715d0f01b
1 changed files with 11 additions and 0 deletions
|
@ -126,6 +126,17 @@ class Webfinger {
|
|||
* identifier and host as values
|
||||
*/
|
||||
public static function get_identifier_and_host( $url ) {
|
||||
if ( ! $url ) {
|
||||
return new WP_Error(
|
||||
'webfinger_invalid_identifier',
|
||||
__( 'Invalid Identifier', 'activitypub' ),
|
||||
array(
|
||||
'status' => 400,
|
||||
'data' => $url,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// remove leading @
|
||||
$url = ltrim( $url, '@' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue