From 030d6166f9ab8b70556f8403f098ab02fa5e6f26 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 24 Jul 2017 22:25:32 +0000 Subject: [PATCH] General: Backport PHP 7.1 fixes to the 4.5 branch to avoid fatal errors and warnings. Props simonvik, ayeshrajans See #41135 Built from https://develop.svn.wordpress.org/branches/4.5@41128 git-svn-id: http://core.svn.wordpress.org/branches/4.5@40968 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-oembed.php | 3 +++ wp-includes/user.php | 2 ++ wp-login.php | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index 3e19f3ba50..f605f786fb 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -221,6 +221,7 @@ class WP_oEmbed { * @return false|string False on failure, otherwise the oEmbed provider URL. */ public function get_provider( $url, $args = '' ) { + $args = wp_parse_args( $args ); $provider = false; @@ -315,6 +316,8 @@ class WP_oEmbed { * @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed. */ public function get_html( $url, $args = '' ) { + $args = wp_parse_args( $args ); + /** * Filters the oEmbed result before any HTTP requests are made. * diff --git a/wp-includes/user.php b/wp-includes/user.php index 69cc86c0d6..b2828d8446 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -27,6 +27,8 @@ */ function wp_signon( $credentials = array(), $secure_cookie = '' ) { if ( empty($credentials) ) { + $credentials = array(); // Back-compat for plugins passing an empty string. + if ( ! empty($_POST['log']) ) $credentials['user_login'] = $_POST['log']; if ( ! empty($_POST['pwd']) ) diff --git a/wp-login.php b/wp-login.php index ed3878c293..b407ce4151 100644 --- a/wp-login.php +++ b/wp-login.php @@ -781,7 +781,7 @@ default: $reauth = empty($_REQUEST['reauth']) ? false : true; - $user = wp_signon( '', $secure_cookie ); + $user = wp_signon( array(), $secure_cookie ); if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) { if ( headers_sent() ) {