diff --git a/readme.html b/readme.html index ac85e53..3517235 100644 --- a/readme.html +++ b/readme.html @@ -9,7 +9,7 @@

WordPress -
Version 3.8.1 +
Version 3.8.2

Semantic Personal Publishing Platform

diff --git a/wp-admin/about.php b/wp-admin/about.php index 8601850..aa8a106 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -39,7 +39,11 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
-

+

+

Version %1$s addressed some security issues and fixed %2$s bug.', + 'Version %1$s addressed some security issues and fixed %2$s bugs.', 9 ), '3.8.2', number_format_i18n( 9 ) ); ?> + the release notes.' ), 'http://codex.wordpress.org/Version_3.8.2' ); ?> +

Version %1$s addressed %2$s bug.', 'Version %1$s addressed %2$s bugs.', 31 ), '3.8.1', number_format_i18n( 31 ) ); ?> the release notes.' ), 'http://codex.wordpress.org/Version_3.8.1' ); ?> diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 2453618..5005411 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -839,7 +839,7 @@ class WP_Posts_List_Table extends WP_List_Table {

diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 1d35c24..af00d4a 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -1871,18 +1871,21 @@ class WP_Automatic_Updater { if ( ! $this->should_update( $type, $item, $context ) ) return false; + $upgrader_item = $item; switch ( $type ) { case 'core': $skin->feedback( __( 'Updating to WordPress %s' ), $item->version ); $item_name = sprintf( __( 'WordPress %s' ), $item->version ); break; case 'theme': - $theme = wp_get_theme( $item ); + $upgrader_item = $item->theme; + $theme = wp_get_theme( $upgrader_item ); $item_name = $theme->Get( 'Name' ); $skin->feedback( __( 'Updating theme: %s' ), $item_name ); break; case 'plugin': - $plugin_data = get_plugin_data( $context . '/' . $item ); + $upgrader_item = $item->plugin; + $plugin_data = get_plugin_data( $context . '/' . $upgrader_item ); $item_name = $plugin_data['Name']; $skin->feedback( __( 'Updating plugin: %s' ), $item_name ); break; @@ -1894,7 +1897,7 @@ class WP_Automatic_Updater { } // Boom, This sites about to get a whole new splash of paint! - $upgrade_result = $upgrader->upgrade( $item, array( + $upgrade_result = $upgrader->upgrade( $upgrader_item, array( 'clear_update_cache' => false, 'pre_check_md5' => false, /* always use partial builds if possible for core updates */ 'attempt_rollback' => true, /* only available for core updates */ @@ -1968,7 +1971,7 @@ class WP_Automatic_Updater { wp_update_plugins(); // Check for Plugin updates $plugin_updates = get_site_transient( 'update_plugins' ); if ( $plugin_updates && !empty( $plugin_updates->response ) ) { - foreach ( array_keys( $plugin_updates->response ) as $plugin ) { + foreach ( $plugin_updates->response as $plugin ) { $this->update( 'plugin', $plugin ); } // Force refresh of plugin update information @@ -1979,8 +1982,8 @@ class WP_Automatic_Updater { wp_update_themes(); // Check for Theme updates $theme_updates = get_site_transient( 'update_themes' ); if ( $theme_updates && !empty( $theme_updates->response ) ) { - foreach ( array_keys( $theme_updates->response ) as $theme ) { - $this->update( 'theme', $theme ); + foreach ( $theme_updates->response as $theme ) { + $this->update( 'theme', (object) $theme ); } // Force refresh of theme update information wp_clean_themes_cache(); @@ -1995,8 +1998,21 @@ class WP_Automatic_Updater { // Clean up, and check for any pending translations // (Core_Upgrader checks for core updates) - wp_update_themes(); // Check for Theme updates - wp_update_plugins(); // Check for Plugin updates + $theme_stats = array(); + if ( isset( $this->update_results['theme'] ) ) { + foreach ( $this->update_results['theme'] as $upgrade ) { + $theme_stats[ $upgrade->item->theme ] = ( true === $upgrade->result ); + } + } + wp_update_themes( $theme_stats ); // Check for Theme updates + + $plugin_stats = array(); + if ( isset( $this->update_results['plugin'] ) ) { + foreach ( $this->update_results['plugin'] as $upgrade ) { + $plugin_stats[ $upgrade->item->plugin ] = ( true === $upgrade->result ); + } + } + wp_update_plugins( $plugin_stats ); // Check for Plugin updates // Finally, Process any new translations $language_updates = wp_get_translation_updates(); diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 983e4e7..bd62497 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -100,6 +100,10 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { $post_id = false; $previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false; + if ( isset( $post_data['post_status'] ) && 'private' == $post_data['post_status'] && ! current_user_can( $ptype->cap->publish_posts ) ) { + $post_data['post_status'] = $previous_status ? $previous_status : 'pending'; + } + $published_statuses = array( 'publish', 'future' ); // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. @@ -111,6 +115,10 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { if ( ! isset($post_data['post_status']) ) $post_data['post_status'] = $previous_status; + if ( isset( $post_data['post_password'] ) && ! current_user_can( $ptype->cap->publish_posts ) ) { + unset( $post_data['post_password'] ); + } + if (!isset( $post_data['comment_status'] )) $post_data['comment_status'] = 'closed'; @@ -170,6 +178,14 @@ function edit_post( $post_data = null ) { $post_data['post_type'] = $post->post_type; $post_data['post_mime_type'] = $post->post_mime_type; + if ( ! empty( $post_data['post_status'] ) ) { + $post_data['post_status'] = sanitize_key( $post_data['post_status'] ); + + if ( 'inherit' == $post_data['post_status'] ) { + unset( $post_data['post_status'] ); + } + } + $ptype = get_post_type_object($post_data['post_type']); if ( !current_user_can( 'edit_post', $post_ID ) ) { if ( 'page' == $post_data['post_type'] ) @@ -187,9 +203,6 @@ function edit_post( $post_data = null ) { _wp_upgrade_revisions_of_post( $post, wp_get_post_revisions( $post_ID ) ); } - $post_data = _wp_translate_postdata( true, $post_data ); - if ( is_wp_error($post_data) ) - wp_die( $post_data->get_error_message() ); if ( ( empty( $post_data['action'] ) || 'autosave' != $post_data['action'] ) && 'auto-draft' == $post_data['post_status'] ) { $post_data['post_status'] = 'draft'; } @@ -210,6 +223,10 @@ function edit_post( $post_data = null ) { } } + $post_data = _wp_translate_postdata( true, $post_data ); + if ( is_wp_error($post_data) ) + wp_die( $post_data->get_error_message() ); + // Post Formats if ( isset( $post_data['post_format'] ) ) set_post_format( $post_ID, $post_data['post_format'] ); @@ -332,6 +349,14 @@ function bulk_edit_posts( $post_data = null ) { } unset($post_data['_status']); + if ( ! empty( $post_data['post_status'] ) ) { + $post_data['post_status'] = sanitize_key( $post_data['post_status'] ); + + if ( 'inherit' == $post_data['post_status'] ) { + unset( $post_data['post_status'] ); + } + } + $post_IDs = array_map( 'intval', (array) $post_data['post'] ); $reset = array( @@ -422,11 +447,26 @@ function bulk_edit_posts( $post_data = null ) { unset( $post_data['tax_input']['category'] ); } + $post_data['post_type'] = $post->post_type; $post_data['post_mime_type'] = $post->post_mime_type; $post_data['guid'] = $post->guid; + foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) { + if ( ! isset( $post_data[ $field ] ) ) { + $post_data[ $field ] = $post->$field; + } + } + $post_data['ID'] = $post_ID; - $updated[] = wp_update_post( $post_data ); + $post_data['post_ID'] = $post_ID; + + $translated_post_data = _wp_translate_postdata( true, $post_data ); + if ( is_wp_error( $translated_post_data ) ) { + $skipped[] = $post_ID; + continue; + } + + $updated[] = wp_update_post( $translated_post_data ); if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) { if ( 'sticky' == $post_data['sticky'] ) @@ -569,10 +609,6 @@ function wp_write_post() { if ( isset( $_POST['post_ID'] ) ) return edit_post(); - $translated = _wp_translate_postdata( false ); - if ( is_wp_error($translated) ) - return $translated; - if ( isset($_POST['visibility']) ) { switch ( $_POST['visibility'] ) { case 'public' : @@ -589,6 +625,10 @@ function wp_write_post() { } } + $translated = _wp_translate_postdata( false ); + if ( is_wp_error($translated) ) + return $translated; + // Create the post. $post_ID = wp_insert_post( $_POST ); if ( is_wp_error( $post_ID ) ) diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 448931d..d4a65e7 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -142,7 +142,7 @@ endif; $ct = wp_get_theme(); if ( $ct->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { - echo '

' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '

'; + echo '

' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '

'; } /* @@ -312,9 +312,9 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
- - - + + +
diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index af41816..86ea3d2 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -226,8 +226,8 @@ function get_bookmarks($args = '') { $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } - if ( $show_updated && get_option('links_recently_updated_time') ) { - $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated "; + if ( $show_updated ) { + $recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated "; } else { $recently_updated_test = ''; } diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 1ab005b..255a29c 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -5390,11 +5390,18 @@ class wp_xmlrpc_server extends IXR_Server { // very stupid, but gives time to the 'from' server to publish ! sleep(1); + $remote_ip = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] ); + $user_agent = apply_filters( 'http_headers_useragent', 'WordPress/' . $GLOBALS['wp_version'] . '; ' . get_bloginfo( 'url' ) ); + // Let's check the remote site $http_api_args = array( 'timeout' => 10, 'redirection' => 0, 'limit_response_size' => 153600, // 150 KB + 'user-agent' => "$user_agent; verifying pingback from $remote_ip", + 'headers' => array( + 'X-Pingback-Forwarded-For' => $remote_ip, + ), ); $linea = wp_remote_retrieve_body( wp_safe_remote_get( $pagelinkedfrom, $http_api_args ) ); diff --git a/wp-includes/js/plupload/plupload.silverlight.xap b/wp-includes/js/plupload/plupload.silverlight.xap index e1584d3..20c8fd8 100644 Binary files a/wp-includes/js/plupload/plupload.silverlight.xap and b/wp-includes/js/plupload/plupload.silverlight.xap differ diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index aca94f3..d84cb0a 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -543,7 +543,7 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') { $key = wp_hash($username . $pass_frag . '|' . $expiration, $scheme); $hash = hash_hmac('md5', $username . '|' . $expiration, $key); - if ( $hmac != $hash ) { + if ( hash_hmac( 'md5', $hmac, $key ) !== hash_hmac( 'md5', $hash, $key ) ) { do_action('auth_cookie_bad_hash', $cookie_elements); return false; } diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 522ad3e..37290d5 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -1248,8 +1248,7 @@ function get_the_password_form( $post = 0 ) { $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); $output = '

' . __( 'This content is password protected. To view it please enter your password below:' ) . '

-

-
+

'; return apply_filters( 'the_password_form', $output ); } @@ -1443,3 +1442,22 @@ function wp_list_post_revisions( $post_id = 0, $type = 'all' ) { echo $rows; echo ""; } + +/** + * Dashboard CSS fixes for 3.8.2. + * + * This function cheaply fixes #WP27082 and #WP26910 in lieu of + * changing the massive wp-admin.css file in a point release. + * This lucky includes file was already receiving an update. + * + * @since 3.8.2 + * @access private + */ +function wp_382_css_hotfix() { + echo ' +'; +} +add_action( 'admin_print_styles', 'wp_382_css_hotfix', 30 ); diff --git a/wp-includes/query.php b/wp-includes/query.php index 8bf292e..446cebc 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -3273,7 +3273,11 @@ class WP_Query { $term = get_term_by( 'slug', $this->get( 'category_name' ), 'category' ); } } elseif ( $this->is_tag ) { - $term = get_term( $this->get( 'tag_id' ), 'post_tag' ); + if ( $this->get( 'tag_id' ) ) { + $term = get_term( $this->get( 'tag_id' ), 'post_tag' ); + } elseif ( $this->get( 'tag' ) ) { + $term = get_term_by( 'slug', $this->get( 'tag' ), 'post_tag' ); + } } else { $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' ); $query = reset( $tax_query_in_and ); diff --git a/wp-includes/update.php b/wp-includes/update.php index c670f9d..ead8e39 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -168,9 +168,10 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) { * @since 2.3.0 * @uses $wp_version Used to notify the WordPress version. * + * @param array $extra_stats Extra statistics to report to the WordPress.org API. * @return mixed Returns null if update is unsupported. Returns false if check is too soon. */ -function wp_update_plugins() { +function wp_update_plugins( $extra_stats = array() ) { include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version if ( defined('WP_INSTALLING') ) @@ -209,7 +210,7 @@ function wp_update_plugins() { $time_not_changed = isset( $current->last_checked ) && $timeout > ( time() - $current->last_checked ); - if ( $time_not_changed ) { + if ( $time_not_changed && ! $extra_stats ) { $plugin_changed = false; foreach ( $plugins as $file => $p ) { $new_option->checked[ $file ] = $p['Version']; @@ -258,6 +259,10 @@ function wp_update_plugins() { 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); + if ( $extra_stats ) { + $options['body']['update_stats'] = json_encode( $extra_stats ); + } + $url = $http_url = 'http://api.wordpress.org/plugins/update-check/1.1/'; if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' ); @@ -299,9 +304,10 @@ function wp_update_plugins() { * @since 2.7.0 * @uses $wp_version Used to notify the WordPress version. * + * @param array $extra_stats Extra statistics to report to the WordPress.org API. * @return mixed Returns null if update is unsupported. Returns false if check is too soon. */ -function wp_update_themes() { +function wp_update_themes( $extra_stats = array() ) { include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version if ( defined( 'WP_INSTALLING' ) ) @@ -351,7 +357,7 @@ function wp_update_themes() { $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked ); - if ( $time_not_changed ) { + if ( $time_not_changed && ! $extra_stats ) { $theme_changed = false; foreach ( $checked as $slug => $v ) { if ( !isset( $last_update->checked[ $slug ] ) || strval($last_update->checked[ $slug ]) !== strval($v) ) @@ -398,6 +404,10 @@ function wp_update_themes() { 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); + if ( $extra_stats ) { + $options['body']['update_stats'] = json_encode( $extra_stats ); + } + $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/'; if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' ); @@ -610,14 +620,14 @@ add_action( 'load-update.php', 'wp_update_plugins' ); add_action( 'load-update-core.php', 'wp_update_plugins' ); add_action( 'admin_init', '_maybe_update_plugins' ); add_action( 'wp_update_plugins', 'wp_update_plugins' ); -add_action( 'upgrader_process_complete', 'wp_update_plugins' ); +add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 ); add_action( 'load-themes.php', 'wp_update_themes' ); add_action( 'load-update.php', 'wp_update_themes' ); add_action( 'load-update-core.php', 'wp_update_themes' ); add_action( 'admin_init', '_maybe_update_themes' ); add_action( 'wp_update_themes', 'wp_update_themes' ); -add_action( 'upgrader_process_complete', 'wp_update_themes' ); +add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); add_action( 'wp_maybe_auto_update', 'wp_maybe_auto_update' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index b9e99e2..b249632 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '3.8.1'; +$wp_version = '3.8.2'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.