From 504ca15a03cc25a406c711406e93a8bd119f9f12 Mon Sep 17 00:00:00 2001 From: Matias Benedetto Date: Tue, 26 Sep 2023 12:11:09 -0300 Subject: [PATCH] syntax refactor repace strpos with str_contains --- .../fonts/font-library/class-wp-font-collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/experimental/fonts/font-library/class-wp-font-collection.php b/lib/experimental/fonts/font-library/class-wp-font-collection.php index 5b3702ae865d1..3dd9b5fed764f 100644 --- a/lib/experimental/fonts/font-library/class-wp-font-collection.php +++ b/lib/experimental/fonts/font-library/class-wp-font-collection.php @@ -79,7 +79,7 @@ public function get_config() { */ public function get_data() { // If the src is a URL, fetch the data from the URL. - if ( false !== strpos( $this->config['src'], 'http' ) && false !== strpos( $this->config['src'], '://' ) ) { + if ( str_contains( $this->config['src'], 'http' ) && str_contains( $this->config['src'], '://' ) ) { if ( ! wp_http_validate_url( $this->config['src'] ) ) { return new WP_Error( 'font_collection_read_error', __( 'Invalid URL for Font Collection data.', 'gutenberg' ) ); }