Making WordPress.org

Changeset 4220


Ignore:
Timestamp:
10/12/2016 11:13:17 AM (8 years ago)
Author:
dd32
Message:

WordPress.tv: Fix wporg_username_exists() to work after the Requests WP_HTTP changes in 4.6.

The response from wp_remote_retrieve_headers() changed from a "real array" to an object implementing ArrayAccess, array_key_exists() is pretty much the one function that could've been used here that was incompatible with it.

Fixes #2130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php

    r2038 r4220  
    845845    $response        = wp_remote_retrieve_headers( wp_remote_get( $validator_url, array( 'redirection' => 0 ) ) );
    846846
    847     if ( array_key_exists( 'location', $response ) ) {
     847    if ( !empty( $response['location'] ) ) {
    848848        if ( false === strpos( $response['location'], 'd=mm' ) ) {
    849849            $username_exists = true;
Note: See TracChangeset for help on using the changeset viewer.