WordPress.org

Make WordPress Core


Ignore:
Location:
branches/3.7
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7/src

  • branches/3.7/src/wp-admin/about.php

    r25914 r25987  
    2222<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
    2323
    24 <div class="about-text"><?php printf( __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ), $display_version ); ?></div>
     24<div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ) ); ?></div>
    2525
    2626<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
     
    3535    </a>
    3636</h2>
     37
     38<div class="changelog point-releases">
     39    <h3><?php echo _n( 'Maintenance Release', 'Maintenance Releases', 1 ); ?></h3>
     40    <p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
     41        '<strong>Version %1$s</strong> addressed %2$s bugs.', 11 ), '3.7.1', number_format_i18n( 11 ) ); ?>
     42        <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.7.1' ); ?>
     43    </p>
     44</div>
    3745
    3846<div class="changelog">
     
    6270            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    6371            $updater = new WP_Automatic_Updater;
    64             $can_auto_update = wp_http_supports( 'ssl' ) && $updater->should_update( 'core', $future_minor_update, ABSPATH );
     72            $can_auto_update = wp_http_supports( array( 'ssl' ) ) && $updater->should_update( 'core', $future_minor_update, ABSPATH );
    6573
    6674            if ( $can_auto_update ) {
  • branches/3.7/src/wp-admin/credits.php

    r25914 r25987  
    8282<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
    8383
    84 <div class="about-text"><?php printf( __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ), $display_version ); ?></div>
     84<div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ) ); ?></div>
    8585
    8686<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
  • branches/3.7/src/wp-admin/freedoms.php

    r25914 r25987  
    2020<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
    2121
    22 <div class="about-text"><?php printf( __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ), $display_version ); ?></div>
     22<div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we&#8217;re okay with that.' ) ); ?></div>
    2323
    2424<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
  • branches/3.7/src/wp-admin/includes/class-wp-upgrader.php

    r25914 r25987  
    21362136        if ( ! $next_user_core_update )
    21372137            $next_user_core_update = $core_update;
    2138         $newer_version_available = ( 'upgrade' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update, '>' ) );
     2138        $newer_version_available = ( 'upgrade' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update->version, '>' ) );
    21392139
    21402140        /**
  • branches/3.7/src/wp-admin/includes/plugin-install.php

    r25914 r25987  
    6161
    6262    if ( false === $res ) {
    63         $url = 'http://api.wordpress.org/plugins/info/1.0/';
    64         if ( wp_http_supports( array( 'ssl' ) ) )
     63        $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
     64        if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    6565            $url = set_url_scheme( $url, 'https' );
    6666
    67         $request = wp_remote_post( $url, array(
     67        $args = array(
    6868            'timeout' => 15,
    6969            'body' => array(
     
    7171                'request' => serialize( $args )
    7272            )
    73         ) );
     73        );
     74        $request = wp_remote_post( $url, $args );
     75
     76        if ( $ssl && is_wp_error( $request ) ) {
     77            trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     78            $request = wp_remote_post( $http_url, $args );
     79        }
    7480
    7581        if ( is_wp_error($request) ) {
  • branches/3.7/src/wp-admin/includes/theme.php

    r25914 r25987  
    283283
    284284    if ( ! $res ) {
    285         $url = 'http://api.wordpress.org/themes/info/1.0/';
    286         if ( wp_http_supports( array( 'ssl' ) ) )
     285        $url = $http_url = 'http://api.wordpress.org/themes/info/1.0/';
     286        if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    287287            $url = set_url_scheme( $url, 'https' );
    288288
    289         $request = wp_remote_post( $url, array(
     289        $args = array(
    290290            'body' => array(
    291291                'action' => $action,
    292292                'request' => serialize( $args )
    293293            )
    294         ) );
     294        );
     295        $request = wp_remote_post( $url, $args );
     296
     297        if ( $ssl && is_wp_error( $request ) ) {
     298            trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     299            $request = wp_remote_post( $http_url, $args );
     300        }
    295301
    296302        if ( is_wp_error($request) ) {
  • branches/3.7/src/wp-admin/includes/update-core.php

    r25914 r25987  
    751751    $skip = array( 'wp-content' );
    752752    $failed = array();
    753     if ( is_array( $checksums ) ) {
     753    if ( isset( $checksums ) && is_array( $checksums ) ) {
    754754        foreach ( $checksums as $file => $checksum ) {
    755755            if ( 0 === strpos( $file, 'wp-content' ) )
  • branches/3.7/src/wp-admin/includes/update.php

    r25914 r25987  
    104104    $return = array();
    105105
    106     $url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
    107 
    108     if ( wp_http_supports( array( 'ssl' ) ) )
     106    $url = $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
     107
     108    if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    109109        $url = set_url_scheme( $url, 'https' );
    110110
     
    114114
    115115    $response = wp_remote_get( $url, $options );
     116    if ( $ssl && is_wp_error( $response ) ) {
     117        trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     118        $response = wp_remote_get( $http_url, $options );
     119    }
    116120
    117121    if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
  • branches/3.7/src/wp-admin/update-core.php

    r25914 r25987  
    147147        _e('You have the latest version of WordPress.');
    148148
    149         if ( wp_http_supports( 'ssl' ) ) {
     149        if ( wp_http_supports( array( 'ssl' ) ) ) {
    150150            require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    151151            $upgrader = new WP_Automatic_Updater;
  • branches/3.7/src/wp-includes/category-template.php

    r25914 r25987  
    233233 */
    234234function in_category( $category, $post = null ) {
     235    if ( empty( $category ) )
     236        return false;
     237
    235238    return has_category( $category, $post );
    236239}
  • branches/3.7/src/wp-includes/default-constants.php

    r25914 r25987  
    4343        $current_limit = @ini_get( 'memory_limit' );
    4444        $current_limit_int = intval( $current_limit );
    45         if ( false !== stripos( $current_limit, 'G' ) )
     45        if ( false !== strpos( $current_limit, 'G' ) )
    4646            $current_limit_int *= 1024;
    4747        $wp_limit_int = intval( WP_MEMORY_LIMIT );
    48         if ( false !== stripos( WP_MEMORY_LIMIT, 'G' ) )
     48        if ( false !== strpos( WP_MEMORY_LIMIT, 'G' ) )
    4949            $wp_limit_int *= 1024;
    5050
  • branches/3.7/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js

    r25914 r25987  
    161161                    div_cls += ' mceIEcenter';
    162162
    163                 return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+( 10 + parseInt(w) )+
     163                w = parseInt( w, 10 ) + 10;
     164                return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+w+
    164165                'px"><dt class="wp-caption-dt">'+img+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>';
    165166            });
  • branches/3.7/src/wp-includes/l10n.php

    r25914 r25987  
    798798        'X-Generator'        => '"X-Generator',
    799799    ) );
    800     foreach ( $headers as &$header ) {
     800    foreach ( $headers as $header => $value ) {
    801801        // Remove possible contextual '\n' and closing double quote.
    802         $header = preg_replace( '~(\\\n)?"$~', '', $header );
     802        $headers[ $header ] = preg_replace( '~(\\\n)?"$~', '', $value );
    803803    }
    804804    return $headers;
  • branches/3.7/src/wp-includes/option.php

    r25914 r25987  
    237237    $serialized_value = maybe_serialize( $value );
    238238
     239    do_action( 'update_option', $option, $old_value, $value );
    239240    $result = $wpdb->update( $wpdb->options, array( 'option_value' => $serialized_value ), array( 'option_name' => $option ) );
    240241    if ( ! $result )
     
    247248    }
    248249
    249     do_action( 'update_option', $option, $old_value, $value );
    250250    if ( ! defined( 'WP_INSTALLING' ) ) {
    251251        $alloptions = wp_load_alloptions();
  • branches/3.7/src/wp-includes/post.php

    r25914 r25987  
    37073707        return $pages;
    37083708
    3709     if ( $parent && ! $child_of )
     3709    if ( $parent > 0 && ! $child_of )
    37103710        $hierarchical = false;
    37113711
  • branches/3.7/src/wp-includes/query.php

    r25914 r25987  
    19871987                $term = trim( $term, "\"' " );
    19881988
    1989             // \p{L} matches a single letter that is not a Chinese, Japanese, etc. char
    1990             if ( ! $term || preg_match( '/^\p{L}$/u', $term ) )
     1989            // Avoid single A-Z.
     1990            if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z]$/i', $term ) ) )
    19911991                continue;
    19921992
  • branches/3.7/src/wp-includes/taxonomy.php

    r25914 r25987  
    13631363    if ( ! empty( $exclude_tree ) ) {
    13641364        $exclude_tree = wp_parse_id_list( $exclude_tree );
    1365         $excluded_children = array();
     1365        $excluded_children = $exclude_tree;
    13661366        foreach ( $exclude_tree as $extrunk ) {
    13671367            $excluded_children = array_merge(
  • branches/3.7/src/wp-includes/update.php

    r25914 r25987  
    9494        $post_body = array_merge( $post_body, $extra_stats );
    9595
    96     $url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
    97     if ( wp_http_supports( array( 'ssl' ) ) )
     96    $url = $http_url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
     97    if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    9898        $url = set_url_scheme( $url, 'https' );
    9999
     
    109109
    110110    $response = wp_remote_post( $url, $options );
     111    if ( $ssl && is_wp_error( $response ) ) {
     112        trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     113        $response = wp_remote_post( $http_url, $options );
     114    }
    111115
    112116    if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
     
    247251    );
    248252
    249     $url = 'http://api.wordpress.org/plugins/update-check/1.1/';
    250     if ( wp_http_supports( array( 'ssl' ) ) )
     253    $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/';
     254    if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    251255        $url = set_url_scheme( $url, 'https' );
    252256
    253257    $raw_response = wp_remote_post( $url, $options );
     258    if ( $ssl && is_wp_error( $raw_response ) ) {
     259        trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     260        $raw_response = wp_remote_post( $http_url, $options );
     261    }
    254262
    255263    if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
     
    383391    );
    384392
    385     $url = 'http://api.wordpress.org/themes/update-check/1.1/';
    386     if ( wp_http_supports( array( 'ssl' ) ) )
     393    $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/';
     394    if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
    387395        $url = set_url_scheme( $url, 'https' );
    388396
    389397    $raw_response = wp_remote_post( $url, $options );
     398    if ( $ssl && is_wp_error( $raw_response ) ) {
     399        trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="http://wordpress.org/support/">support forums</a>.' ) . ' ' . '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     400        $raw_response = wp_remote_post( $http_url, $options );
     401    }
    390402
    391403    if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
  • branches/3.7/src/wp-includes/user.php

    r25914 r25987  
    213213 */
    214214function get_current_user_id() {
     215    if ( ! function_exists( 'wp_get_current_user' ) )
     216        return 0;
    215217    $user = wp_get_current_user();
    216218    return ( isset( $user->ID ) ? (int) $user->ID : 0 );
  • branches/3.7/src/wp-includes/version.php

    r25914 r25987  
    55 * @global string $wp_version
    66 */
    7 $wp_version = '3.7.1-alpha-src';
     7$wp_version = '3.7.1-src';
    88
    99/**
     
    1919 * @global string $tinymce_version
    2020 */
    21 $tinymce_version = '359-20131018';
     21$tinymce_version = '359-20131026';
    2222
    2323/**
  • branches/3.7/tests/phpunit/tests/post/getPages.php

    r25914 r25987  
    129129        $this->assertEqualSets( $child_ids, $post_ids );
    130130    }
     131
     132    /**
     133     * @ticket 25750
     134     */
     135    function test_get_pages_hierarchical_and_no_parent() {
     136        global $wpdb;
     137        $page_1 = $this->factory->post->create( array( 'post_type' => 'page' ) );
     138        $page_2 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_1 ) );
     139        $page_3 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_1 ) );
     140        $page_4 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_2 ) );
     141
     142        $pages = get_pages(); // Defaults: hierarchical = true, parent = -1
     143        $pages_default_args = get_pages( array( 'hierarchical' => true, 'parent' => -1 ) );
     144        // Confirm the defaults.
     145        $this->assertEquals( $pages, $pages_default_args );
     146
     147        /*
     148         * Here's the tree we are testing:
     149         *
     150         * page 1
     151         * - page 2
     152         * -- page 4
     153         * - page 3
     154         *
     155         * If hierarchical => true works, the order will be 1,2,4,3.
     156         * If it doesn't, they will be in the creation order, 1,2,3,4.
     157         */
     158
     159        $this->assertEqualSets( array( $page_1, $page_2, $page_4, $page_3 ), wp_list_pluck( $pages, 'ID' ) );
     160    }
    131161}
  • branches/3.7/tests/phpunit/tests/taxonomy.php

    r25914 r25987  
    153153
    154154    }
     155    /**
     156     * @ticket 25706
     157     */
     158    function test_in_category() {
     159        $post = $this->factory->post->create_and_get();
     160
     161        // in_category() returns false when first parameter is empty()
     162        $this->assertFalse( in_category( '', $post ) );
     163        $this->assertFalse( in_category( false, $post ) );
     164        $this->assertFalse( in_category( null, $post ) );
     165
     166        // Test expected behavior of in_category()
     167        $term = wp_insert_term( 'Test', 'category' );
     168        wp_set_object_terms( $post->ID, $term['term_id'], 'category' );
     169        $this->assertTrue( in_category( $term['term_id'], $post ) );
     170    }
    155171}
  • branches/3.7/tests/phpunit/tests/term/getTerms.php

    r25914 r25987  
    153153
    154154    /**
     155     * @ticket 25710
     156     */
     157    function test_get_terms_exclude_tree() {
     158
     159        $term_id_uncategorized = get_option( 'default_category' );
     160
     161        $term_id1 = $this->factory->category->create();
     162        $term_id11 = $this->factory->category->create( array( 'parent' => $term_id1 ) );
     163        $term_id2 = $this->factory->category->create();
     164        $term_id22 = $this->factory->category->create( array( 'parent' => $term_id2 ) );
     165
     166        // There's something else broken in the cache cleaning routines that leads to this having to be done manually
     167        delete_option( 'category_children' );
     168
     169        $terms = get_terms( 'category', array(
     170            'exclude' => $term_id_uncategorized,
     171            'fields' => 'ids',
     172            'hide_empty' => false,
     173        ) );
     174        $this->assertEquals( array( $term_id1, $term_id11, $term_id2, $term_id22 ), $terms );
     175
     176        $terms = get_terms( 'category', array(
     177            'fields' => 'ids',
     178            'exclude_tree' => "$term_id1,$term_id_uncategorized",
     179            'hide_empty' => false,
     180        ) );
     181
     182        $this->assertEquals( array( $term_id2, $term_id22 ), $terms );
     183
     184    }
     185
     186    /**
    155187     * @ticket 13992
    156188     */
Note: See TracChangeset for help on using the changeset viewer.