Making WordPress.org

Ticket #776: 776.patch

File 776.patch, 1.2 KB (added by ocean90, 10 years ago)
  • trunk/api.wordpress.org/public_html/translations/lib.php

     
    1919                $version = WP_CORE_LATEST_RELEASE;
    2020        }
    2121
     22        $version = implode( '.', array_slice( preg_split( '/[.-]/', $version ), 0, 2 ) ); // x.y
     23
    2224        $cache_group = 'translations-query';
    2325        $cache_time = 900; // 15 min
    2426        $cache_key = "$type:$domain:$version";
    25        
     27
    2628        $translations = wp_cache_get( $cache_key, $cache_group );
    2729        if ( '_empty_' === $translations ) {
    2830                return array();
     
    100102                if ( isset( $_translations[ $key ] ) ) {
    101103                        $key .= ++$i;
    102104                }
    103        
     105
    104106                $_translations[ $key ] = $translation;
    105107                $_translations[ $key ]->english_name = $locale->english_name;
    106108                $_translations[ $key ]->native_name = $locale->native_name;
     
    156158
    157159                usort( $results, 'version_compare_version_key_desc' );
    158160                if ( $version ) {
    159                         $found = false;             
     161                        $found = false;
    160162                        foreach ( $results as $result ) {
    161163                                if ( version_compare( $result['version'], $version, '<=' ) ) {
    162164                                        $found = true;