From a8be3519837b6a8ad7ddc4ffc115a2cd5ca77c24 Mon Sep 17 00:00:00 2001 From: Dave Jesch Date: Sun, 29 Dec 2019 22:54:34 -0800 Subject: [PATCH] I noticed that when $source refers to a relative URL, the value returned from parse_url() is false. This causes a Deprecated warning message to be displayed when strpos() is called a few lines later. This change avoids that issue and reduces non-fatal messages from being displayed. --- airplane-mode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airplane-mode.php b/airplane-mode.php index ed097ce..2ac7414 100644 --- a/airplane-mode.php +++ b/airplane-mode.php @@ -334,7 +334,7 @@ public function block_script_load( $source ) { $parsed = parse_url( $source, PHP_URL_HOST ); // First run the filter to allow a source host to get through. - if ( false === apply_filters( 'airplane_mode_parse_script', true, $parsed ) ) { + if ( false === apply_filters( 'airplane_mode_parse_script', true, $parsed ) || false === $parsed ) { return $source; }