Replace `is_https_url()` with `'https' === parse_url( $url, PHP_URL_SCHEME )`.
see #28427, #28487. Built from https://develop.svn.wordpress.org/trunk@29311 git-svn-id: http://core.svn.wordpress.org/trunk@29092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
241addd9ab
commit
2e4be94288
|
@ -735,7 +735,7 @@ function wp_set_comment_cookies($comment, $user) {
|
|||
* @param int $seconds Comment cookie lifetime. Default 30000000.
|
||||
*/
|
||||
$comment_cookie_lifetime = apply_filters( 'comment_cookie_lifetime', 30000000 );
|
||||
$secure = is_https_url( home_url() );
|
||||
$secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
|
||||
setcookie( 'comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
setcookie( 'comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
setcookie( 'comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
|
|
|
@ -746,7 +746,7 @@ function wp_user_settings() {
|
|||
}
|
||||
|
||||
// The cookie is not set in the current browser or the saved value is newer.
|
||||
$secure = is_https_url( site_url() );
|
||||
$secure = ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) );
|
||||
setcookie( 'wp-settings-' . $user_id, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
setcookie( 'wp-settings-time-' . $user_id, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
$_COOKIE['wp-settings-' . $user_id] = $settings;
|
||||
|
|
|
@ -427,7 +427,7 @@ if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set
|
|||
}
|
||||
|
||||
//Set a cookie now to see if they are supported by the browser.
|
||||
$secure = ( is_https_url( home_url() ) && is_https_url( site_url() ) );
|
||||
$secure = ( 'https' === parse_url( site_url(), PHP_URL_SCHEME ) && 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
|
||||
setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
if ( SITECOOKIEPATH != COOKIEPATH )
|
||||
setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
|
@ -469,7 +469,7 @@ case 'postpass' :
|
|||
* @param int $expires The expiry time, as passed to setcookie().
|
||||
*/
|
||||
$expire = apply_filters( 'post_password_expires', time() + 10 * DAY_IN_SECONDS );
|
||||
$secure = is_https_url( home_url() );
|
||||
$secure = ( 'https' === parse_url( home_url(), PHP_URL_SCHEME ) );
|
||||
setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
|
||||
|
||||
wp_safe_redirect( wp_get_referer() );
|
||||
|
|
Loading…
Reference in New Issue