diff --git a/includes/functions.php b/includes/functions.php index d1b7991..31d29cf 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -300,7 +300,7 @@ function get_blacklist() { $blacklist_hosts = \explode( PHP_EOL, $blacklist ); // if no values have been set, revert to the defaults - if ( ! $blacklist || ! $blacklist_hosts || ! is_array( $blacklist_hosts ) ) { + if ( ! $blacklist || ! $blacklist_hosts || ! \is_array( $blacklist_hosts ) ) { $blacklist_hosts = array( 'gab.com', ); diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 3709d4e..baca644 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -126,7 +126,7 @@ class Inbox { 'required' => true, 'type' => 'string', 'validate_callback' => function( $param, $request, $key ) { - if ( ! is_string( $param ) ) { + if ( ! \is_string( $param ) ) { $param = $param['id']; } return ! \Activitypub\is_blacklisted( $param ); @@ -138,13 +138,13 @@ class Inbox { 'required' => true, 'type' => array( 'object', 'string' ), 'validate_callback' => function( $param, $request, $key ) { - if ( ! is_string( $param ) ) { + if ( ! \is_string( $param ) ) { $param = $param['id']; } return ! \Activitypub\is_blacklisted( $param ); }, 'sanitize_callback' => function( $param, $request, $key ) { - if ( ! is_string( $param ) ) { + if ( ! \is_string( $param ) ) { $param = $param['id']; } return \esc_url_raw( $param ); diff --git a/includes/rest/class-server.php b/includes/rest/class-server.php index 79926fc..841c6ba 100644 --- a/includes/rest/class-server.php +++ b/includes/rest/class-server.php @@ -19,7 +19,7 @@ class Server extends \WP_REST_Server { $content_type = $request->get_content_type(); // check for content-sub-types like 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' - if ( preg_match( '/application\/([a-zA-Z+_-]+\+)json/', $content_type['value'] ) ) { + if ( \preg_match( '/application\/([a-zA-Z+_-]+\+)json/', $content_type['value'] ) ) { $request->set_header( 'Content-Type', 'application/json' ); }