WordPress.org

Make WordPress Core

Ticket #18629: 18629.4.patch

File 18629.4.patch, 2.3 KB (added by SergeyBiryukov, 9 years ago)
  • wp-admin/includes/update.php

     
    8383
    8484function core_update_footer( $msg = '' ) {
    8585        if ( !current_user_can('update_core') )
    86                 return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
     86                return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
    8787
    8888        $cur = get_preferred_from_update_core();
    8989        if ( ! is_object( $cur ) )
     
    100100
    101101        switch ( $cur->response ) {
    102102        case 'development' :
    103                 return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], network_admin_url( 'update-core.php' ) );
     103                return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), get_bloginfo( 'version', 'display' ), network_admin_url( 'update-core.php' ) );
    104104        break;
    105105
    106106        case 'upgrade' :
     
    109109
    110110        case 'latest' :
    111111        default :
    112                 return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] );
     112                return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
    113113        break;
    114114        }
    115115}
     
    140140
    141141// Called directly from dashboard
    142142function update_right_now_message() {
    143         $msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), $GLOBALS['wp_version'] );
     143        $msg = sprintf( __( 'You are using <span class="b">WordPress %s</span>.' ), get_bloginfo( 'version', 'display' ) );
    144144
    145145        if ( current_user_can('update_core') ) {
    146146                $cur = get_preferred_from_update_core();
     
    152152        echo "<span id='wp-version-message'>$msg</span>";
    153153}
    154154
     155/**
     156 * Adds SVN revision to WordPress version, if appropriate
     157 *
     158 * @since 3.5.0
     159 */
     160function get_svn_revision( $output, $show ) {
     161        if ( 'version' != $show || ! current_user_can( 'update_core' ) || false === strpos( $output, '-' ) )
     162                return $output;
     163
     164        if ( file_exists( ABSPATH . '.svn/entries' ) && $svn = file( ABSPATH . '.svn/entries' ) && isset( $svn[3] ) ) {
     165                $output = preg_replace ( '/-[0-9]+$/', '', $output );
     166                $output .= '-r' . trim( $svn[3] );
     167        }
     168
     169        return $output;
     170}
     171add_filter( 'bloginfo', 'get_svn_revision', 10, 2 );
     172
    155173function get_plugin_updates() {
    156174        $all_plugins = get_plugins();
    157175        $upgrade_plugins = array();