diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 36dce7795d..800e468f3f 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -312,10 +312,12 @@ if ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) : $excluded_referer_basenames = array( 'plugin-editor.php', 'wp-login.php' ); - if ( $referer && ! in_array( basename( parse_url( $referer, PHP_URL_PATH ) ), $excluded_referer_basenames, true ) ) { - $return_url = $referer; - } else { - $return_url = admin_url( '/' ); + $return_url = admin_url( '/' ); + if ( $referer ) { + $referer_path = parse_url( $referer, PHP_URL_PATH ); + if ( is_string( $referer_path ) && ! in_array( basename( $referer_path ), $excluded_referer_basenames, true ) ) { + $return_url = $referer; + } } ?>