Skip to content

Commit

Permalink
syntax refactor repace strpos with str_contains (#54832)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenedetto authored and mikachan committed Sep 29, 2023
1 parent 9dea2a3 commit c20f4a1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
}
Expand Down

0 comments on commit c20f4a1

Please sign in to comment.