Making WordPress.org

Changeset 8552


Ignore:
Timestamp:
03/29/2019 05:56:21 AM (5 years ago)
Author:
dd32
Message:

WordCamp Utilities: Meetup Events fetcher: Handle a change in the Meetup API response.

The API used to return multiple Link: headers, however now returns a single combined header which causes this API client to get in a endless loop of fetching page 0, then 1, then 0, then 1..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/utilities/class-meetup-client.php

    r7881 r8552  
    270270        $links = wp_remote_retrieve_header( $response, 'link' );
    271271        if ( $links ) {
     272            // Meetup.com is now returning combined link headers
     273            if ( is_string( $links ) ) {
     274                $links = preg_split( '!,\s+!', $links );
     275            }
    272276            foreach ( (array) $links as $link ) {
    273277                if ( false !== strpos( $link, 'rel="next"' ) && preg_match( '/^<([^>]+)>/', $link, $matches ) ) {
Note: See TracChangeset for help on using the changeset viewer.