WordPress.org

Making WordPress.org

Changeset 5133


Ignore:
Timestamp:
03/08/17 20:14:09 (5 months ago)
Author:
coffee2code
Message:

Credits API: Return 'version' value that matches the data being returned.

For invalid version requests (e.g. something pre-3.2 or post-WP_CORE_STABLE_BRANCH), the Credits API returns data for WP_CORE_STABLE_BRANCH. In such cases the 'version' value in the response was the invalid version being requested.

The returned 'version' should instead reflect the version that matches the data. API consumers can compare their requested version to the response version to see if the fallback (current stable) is being returned.

Props markoheijnen.
Fixes #577.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/credits/wp-credits.php

    r4490 r5133  
    6262                require_once $file; 
    6363                $class = 'WP_' . $branch . '_Credits'; 
    64                 $credits = new $class( $version, $gp_locale ); 
     64                $credits = new $class( WP_CORE_STABLE_BRANCH, $gp_locale ); 
    6565                return $credits; 
    6666            } 
Note: See TracChangeset for help on using the changeset viewer.