Skip to content

Commit c20f4a1

Browse files
matiasbenedettomikachan
authored andcommitted
syntax refactor repace strpos with str_contains (#54832)
1 parent 9dea2a3 commit c20f4a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/experimental/fonts/font-library/class-wp-font-collection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function get_config() {
7979
*/
8080
public function get_data() {
8181
// If the src is a URL, fetch the data from the URL.
82-
if ( false !== strpos( $this->config['src'], 'http' ) && false !== strpos( $this->config['src'], '://' ) ) {
82+
if ( str_contains( $this->config['src'], 'http' ) && str_contains( $this->config['src'], '://' ) ) {
8383
if ( ! wp_http_validate_url( $this->config['src'] ) ) {
8484
return new WP_Error( 'font_collection_read_error', __( 'Invalid URL for Font Collection data.', 'gutenberg' ) );
8585
}

0 commit comments

Comments
 (0)