check if $resource is set
This commit is contained in:
parent
60148a3b65
commit
d00e5a03c8
1 changed files with 5 additions and 0 deletions
|
@ -41,9 +41,14 @@ class Webfinger {
|
|||
* @return string|WP_Error The URL or WP_Error
|
||||
*/
|
||||
public static function resolve( $resource ) {
|
||||
if ( ! $resource ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( ! preg_match( '/^@?' . ACTIVITYPUB_USERNAME_REGEXP . '$/i', $resource, $m ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$transient_key = 'activitypub_resolve_' . ltrim( $resource, '@' );
|
||||
|
||||
$link = \get_transient( $transient_key );
|
||||
|
|
Loading…
Reference in a new issue