Ticket #776: 776.patch
File 776.patch, 1.2 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 $version = implode( '.', array_slice( preg_split( '/[.-]/', $version ), 0, 2 ) ); // x.y 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(); … … 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;