Ticket #776: 776.2.patch
File 776.2.patch, 1.6 KB (added by , 10 years ago) |
---|
-
trunk/api.wordpress.org/public_html/translations/lib.php
19 19 $version = WP_CORE_LATEST_RELEASE; 20 20 } 21 21 22 $is_development_version = (bool) strpos( $version, '-' ); 23 22 24 $cache_group = 'translations-query'; 23 25 $cache_time = 900; // 15 min 24 26 $cache_key = "$type:$domain:$version"; 25 27 26 28 $translations = wp_cache_get( $cache_key, $cache_group ); 27 29 if ( '_empty_' === $translations ) { 28 30 return array(); … … 43 45 if ( isset( $_translations[ $translation->language ] ) ) { 44 46 continue; 45 47 } 46 if ( ! $version || $ version === $translation->version || version_compare( $version, $translation->version, '>=' ) ) {48 if ( ! $version || $is_development_version || $version === $translation->version || version_compare( $version, $translation->version, '>=' ) ) { 47 49 $_translations[ $translation->language ] = $translation; 48 50 } 49 51 } … … 100 102 if ( isset( $_translations[ $key ] ) ) { 101 103 $key .= ++$i; 102 104 } 103 105 104 106 $_translations[ $key ] = $translation; 105 107 $_translations[ $key ]->english_name = $locale->english_name; 106 108 $_translations[ $key ]->native_name = $locale->native_name; … … 156 158 157 159 usort( $results, 'version_compare_version_key_desc' ); 158 160 if ( $version ) { 159 $found = false; 161 $found = false; 160 162 foreach ( $results as $result ) { 161 163 if ( version_compare( $result['version'], $version, '<=' ) ) { 162 164 $found = true;