Index: branches/3.7/src/wp-admin/about.php
===================================================================
--- branches/3.7/src/wp-admin/about.php (revision 25914)
+++ branches/3.7/src/wp-admin/about.php (revision 25987)
@@ -22,5 +22,5 @@
@@ -62,5 +70,5 @@
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$updater = new WP_Automatic_Updater;
- $can_auto_update = wp_http_supports( 'ssl' ) && $updater->should_update( 'core', $future_minor_update, ABSPATH );
+ $can_auto_update = wp_http_supports( array( 'ssl' ) ) && $updater->should_update( 'core', $future_minor_update, ABSPATH );
if ( $can_auto_update ) {
Index: branches/3.7/src/wp-admin/credits.php
===================================================================
--- branches/3.7/src/wp-admin/credits.php (revision 25914)
+++ branches/3.7/src/wp-admin/credits.php (revision 25987)
@@ -82,5 +82,5 @@
-
+
Index: branches/3.7/src/wp-admin/freedoms.php
===================================================================
--- branches/3.7/src/wp-admin/freedoms.php (revision 25914)
+++ branches/3.7/src/wp-admin/freedoms.php (revision 25987)
@@ -20,5 +20,5 @@
-
+
Index: branches/3.7/src/wp-admin/includes/class-wp-upgrader.php
===================================================================
--- branches/3.7/src/wp-admin/includes/class-wp-upgrader.php (revision 25914)
+++ branches/3.7/src/wp-admin/includes/class-wp-upgrader.php (revision 25987)
@@ -2136,5 +2136,5 @@
if ( ! $next_user_core_update )
$next_user_core_update = $core_update;
- $newer_version_available = ( 'upgrade' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update, '>' ) );
+ $newer_version_available = ( 'upgrade' == $next_user_core_update->response && version_compare( $next_user_core_update->version, $core_update->version, '>' ) );
/**
Index: branches/3.7/src/wp-admin/includes/plugin-install.php
===================================================================
--- branches/3.7/src/wp-admin/includes/plugin-install.php (revision 25914)
+++ branches/3.7/src/wp-admin/includes/plugin-install.php (revision 25987)
@@ -61,9 +61,9 @@
if ( false === $res ) {
- $url = 'http://api.wordpress.org/plugins/info/1.0/';
- if ( wp_http_supports( array( 'ssl' ) ) )
+ $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
- $request = wp_remote_post( $url, array(
+ $args = array(
'timeout' => 15,
'body' => array(
@@ -71,5 +71,11 @@
'request' => serialize( $args )
)
- ) );
+ );
+ $request = wp_remote_post( $url, $args );
+
+ if ( $ssl && is_wp_error( $request ) ) {
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the
support forums.' ) . ' ' . '(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 );
+ $request = wp_remote_post( $http_url, $args );
+ }
if ( is_wp_error($request) ) {
Index: branches/3.7/src/wp-admin/includes/theme.php
===================================================================
--- branches/3.7/src/wp-admin/includes/theme.php (revision 25914)
+++ branches/3.7/src/wp-admin/includes/theme.php (revision 25987)
@@ -283,14 +283,20 @@
if ( ! $res ) {
- $url = 'http://api.wordpress.org/themes/info/1.0/';
- if ( wp_http_supports( array( 'ssl' ) ) )
+ $url = $http_url = 'http://api.wordpress.org/themes/info/1.0/';
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
- $request = wp_remote_post( $url, array(
+ $args = array(
'body' => array(
'action' => $action,
'request' => serialize( $args )
)
- ) );
+ );
+ $request = wp_remote_post( $url, $args );
+
+ if ( $ssl && is_wp_error( $request ) ) {
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the
support forums.' ) . ' ' . '(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 );
+ $request = wp_remote_post( $http_url, $args );
+ }
if ( is_wp_error($request) ) {
Index: branches/3.7/src/wp-admin/includes/update-core.php
===================================================================
--- branches/3.7/src/wp-admin/includes/update-core.php (revision 25914)
+++ branches/3.7/src/wp-admin/includes/update-core.php (revision 25987)
@@ -751,5 +751,5 @@
$skip = array( 'wp-content' );
$failed = array();
- if ( is_array( $checksums ) ) {
+ if ( isset( $checksums ) && is_array( $checksums ) ) {
foreach ( $checksums as $file => $checksum ) {
if ( 0 === strpos( $file, 'wp-content' ) )
Index: branches/3.7/src/wp-admin/includes/update.php
===================================================================
--- branches/3.7/src/wp-admin/includes/update.php (revision 25914)
+++ branches/3.7/src/wp-admin/includes/update.php (revision 25987)
@@ -104,7 +104,7 @@
$return = array();
- $url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
-
- if ( wp_http_supports( array( 'ssl' ) ) )
+ $url = $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' );
+
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
@@ -114,4 +114,8 @@
$response = wp_remote_get( $url, $options );
+ if ( $ssl && is_wp_error( $response ) ) {
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the
support forums.' ) . ' ' . '(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 );
+ $response = wp_remote_get( $http_url, $options );
+ }
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
Index: branches/3.7/src/wp-admin/update-core.php
===================================================================
--- branches/3.7/src/wp-admin/update-core.php (revision 25914)
+++ branches/3.7/src/wp-admin/update-core.php (revision 25987)
@@ -147,5 +147,5 @@
_e('You have the latest version of WordPress.');
- if ( wp_http_supports( 'ssl' ) ) {
+ if ( wp_http_supports( array( 'ssl' ) ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
$upgrader = new WP_Automatic_Updater;
Index: branches/3.7/src/wp-includes/category-template.php
===================================================================
--- branches/3.7/src/wp-includes/category-template.php (revision 25914)
+++ branches/3.7/src/wp-includes/category-template.php (revision 25987)
@@ -233,4 +233,7 @@
*/
function in_category( $category, $post = null ) {
+ if ( empty( $category ) )
+ return false;
+
return has_category( $category, $post );
}
Index: branches/3.7/src/wp-includes/default-constants.php
===================================================================
--- branches/3.7/src/wp-includes/default-constants.php (revision 25914)
+++ branches/3.7/src/wp-includes/default-constants.php (revision 25987)
@@ -43,8 +43,8 @@
$current_limit = @ini_get( 'memory_limit' );
$current_limit_int = intval( $current_limit );
- if ( false !== stripos( $current_limit, 'G' ) )
+ if ( false !== strpos( $current_limit, 'G' ) )
$current_limit_int *= 1024;
$wp_limit_int = intval( WP_MEMORY_LIMIT );
- if ( false !== stripos( WP_MEMORY_LIMIT, 'G' ) )
+ if ( false !== strpos( WP_MEMORY_LIMIT, 'G' ) )
$wp_limit_int *= 1024;
Index: branches/3.7/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js
===================================================================
--- branches/3.7/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js (revision 25914)
+++ branches/3.7/src/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js (revision 25987)
@@ -161,5 +161,6 @@
div_cls += ' mceIEcenter';
- return '
';
});
Index: branches/3.7/src/wp-includes/l10n.php
===================================================================
--- branches/3.7/src/wp-includes/l10n.php (revision 25914)
+++ branches/3.7/src/wp-includes/l10n.php (revision 25987)
@@ -798,7 +798,7 @@
'X-Generator' => '"X-Generator',
) );
- foreach ( $headers as &$header ) {
+ foreach ( $headers as $header => $value ) {
// Remove possible contextual '\n' and closing double quote.
- $header = preg_replace( '~(\\\n)?"$~', '', $header );
+ $headers[ $header ] = preg_replace( '~(\\\n)?"$~', '', $value );
}
return $headers;
Index: branches/3.7/src/wp-includes/option.php
===================================================================
--- branches/3.7/src/wp-includes/option.php (revision 25914)
+++ branches/3.7/src/wp-includes/option.php (revision 25987)
@@ -237,4 +237,5 @@
$serialized_value = maybe_serialize( $value );
+ do_action( 'update_option', $option, $old_value, $value );
$result = $wpdb->update( $wpdb->options, array( 'option_value' => $serialized_value ), array( 'option_name' => $option ) );
if ( ! $result )
@@ -247,5 +248,4 @@
}
- do_action( 'update_option', $option, $old_value, $value );
if ( ! defined( 'WP_INSTALLING' ) ) {
$alloptions = wp_load_alloptions();
Index: branches/3.7/src/wp-includes/post.php
===================================================================
--- branches/3.7/src/wp-includes/post.php (revision 25914)
+++ branches/3.7/src/wp-includes/post.php (revision 25987)
@@ -3707,5 +3707,5 @@
return $pages;
- if ( $parent && ! $child_of )
+ if ( $parent > 0 && ! $child_of )
$hierarchical = false;
Index: branches/3.7/src/wp-includes/query.php
===================================================================
--- branches/3.7/src/wp-includes/query.php (revision 25914)
+++ branches/3.7/src/wp-includes/query.php (revision 25987)
@@ -1987,6 +1987,6 @@
$term = trim( $term, "\"' " );
- // \p{L} matches a single letter that is not a Chinese, Japanese, etc. char
- if ( ! $term || preg_match( '/^\p{L}$/u', $term ) )
+ // Avoid single A-Z.
+ if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z]$/i', $term ) ) )
continue;
Index: branches/3.7/src/wp-includes/taxonomy.php
===================================================================
--- branches/3.7/src/wp-includes/taxonomy.php (revision 25914)
+++ branches/3.7/src/wp-includes/taxonomy.php (revision 25987)
@@ -1363,5 +1363,5 @@
if ( ! empty( $exclude_tree ) ) {
$exclude_tree = wp_parse_id_list( $exclude_tree );
- $excluded_children = array();
+ $excluded_children = $exclude_tree;
foreach ( $exclude_tree as $extrunk ) {
$excluded_children = array_merge(
Index: branches/3.7/src/wp-includes/update.php
===================================================================
--- branches/3.7/src/wp-includes/update.php (revision 25914)
+++ branches/3.7/src/wp-includes/update.php (revision 25987)
@@ -94,6 +94,6 @@
$post_body = array_merge( $post_body, $extra_stats );
- $url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
- if ( wp_http_supports( array( 'ssl' ) ) )
+ $url = $http_url = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, null, '&' );
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) )
$url = set_url_scheme( $url, 'https' );
@@ -109,4 +109,8 @@
$response = wp_remote_post( $url, $options );
+ if ( $ssl && is_wp_error( $response ) ) {
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the
support forums.' ) . ' ' . '(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 );
+ $response = wp_remote_post( $http_url, $options );
+ }
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
@@ -247,9 +251,13 @@
);
- $url = 'http://api.wordpress.org/plugins/update-check/1.1/';
- if ( wp_http_supports( array( 'ssl' ) ) )
+ $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' );
$raw_response = wp_remote_post( $url, $options );
+ if ( $ssl && is_wp_error( $raw_response ) ) {
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the
support forums.' ) . ' ' . '(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 );
+ $raw_response = wp_remote_post( $http_url, $options );
+ }
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
@@ -383,9 +391,13 @@
);
- $url = 'http://api.wordpress.org/themes/update-check/1.1/';
- if ( wp_http_supports( array( 'ssl' ) ) )
+ $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' );
$raw_response = wp_remote_post( $url, $options );
+ if ( $ssl && is_wp_error( $raw_response ) ) {
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the
support forums.' ) . ' ' . '(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 );
+ $raw_response = wp_remote_post( $http_url, $options );
+ }
if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) )
Index: branches/3.7/src/wp-includes/user.php
===================================================================
--- branches/3.7/src/wp-includes/user.php (revision 25914)
+++ branches/3.7/src/wp-includes/user.php (revision 25987)
@@ -213,4 +213,6 @@
*/
function get_current_user_id() {
+ if ( ! function_exists( 'wp_get_current_user' ) )
+ return 0;
$user = wp_get_current_user();
return ( isset( $user->ID ) ? (int) $user->ID : 0 );
Index: branches/3.7/src/wp-includes/version.php
===================================================================
--- branches/3.7/src/wp-includes/version.php (revision 25914)
+++ branches/3.7/src/wp-includes/version.php (revision 25987)
@@ -5,5 +5,5 @@
* @global string $wp_version
*/
-$wp_version = '3.7.1-alpha-src';
+$wp_version = '3.7.1-src';
/**
@@ -19,5 +19,5 @@
* @global string $tinymce_version
*/
-$tinymce_version = '359-20131018';
+$tinymce_version = '359-20131026';
/**
Index: branches/3.7/tests/phpunit/tests/post/getPages.php
===================================================================
--- branches/3.7/tests/phpunit/tests/post/getPages.php (revision 25914)
+++ branches/3.7/tests/phpunit/tests/post/getPages.php (revision 25987)
@@ -129,3 +129,33 @@
$this->assertEqualSets( $child_ids, $post_ids );
}
+
+ /**
+ * @ticket 25750
+ */
+ function test_get_pages_hierarchical_and_no_parent() {
+ global $wpdb;
+ $page_1 = $this->factory->post->create( array( 'post_type' => 'page' ) );
+ $page_2 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_1 ) );
+ $page_3 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_1 ) );
+ $page_4 = $this->factory->post->create( array( 'post_type' => 'page', 'post_parent' => $page_2 ) );
+
+ $pages = get_pages(); // Defaults: hierarchical = true, parent = -1
+ $pages_default_args = get_pages( array( 'hierarchical' => true, 'parent' => -1 ) );
+ // Confirm the defaults.
+ $this->assertEquals( $pages, $pages_default_args );
+
+ /*
+ * Here's the tree we are testing:
+ *
+ * page 1
+ * - page 2
+ * -- page 4
+ * - page 3
+ *
+ * If hierarchical => true works, the order will be 1,2,4,3.
+ * If it doesn't, they will be in the creation order, 1,2,3,4.
+ */
+
+ $this->assertEqualSets( array( $page_1, $page_2, $page_4, $page_3 ), wp_list_pluck( $pages, 'ID' ) );
+ }
}
Index: branches/3.7/tests/phpunit/tests/taxonomy.php
===================================================================
--- branches/3.7/tests/phpunit/tests/taxonomy.php (revision 25914)
+++ branches/3.7/tests/phpunit/tests/taxonomy.php (revision 25987)
@@ -153,3 +153,19 @@
}
+ /**
+ * @ticket 25706
+ */
+ function test_in_category() {
+ $post = $this->factory->post->create_and_get();
+
+ // in_category() returns false when first parameter is empty()
+ $this->assertFalse( in_category( '', $post ) );
+ $this->assertFalse( in_category( false, $post ) );
+ $this->assertFalse( in_category( null, $post ) );
+
+ // Test expected behavior of in_category()
+ $term = wp_insert_term( 'Test', 'category' );
+ wp_set_object_terms( $post->ID, $term['term_id'], 'category' );
+ $this->assertTrue( in_category( $term['term_id'], $post ) );
+ }
}
Index: branches/3.7/tests/phpunit/tests/term/getTerms.php
===================================================================
--- branches/3.7/tests/phpunit/tests/term/getTerms.php (revision 25914)
+++ branches/3.7/tests/phpunit/tests/term/getTerms.php (revision 25987)
@@ -153,4 +153,36 @@
/**
+ * @ticket 25710
+ */
+ function test_get_terms_exclude_tree() {
+
+ $term_id_uncategorized = get_option( 'default_category' );
+
+ $term_id1 = $this->factory->category->create();
+ $term_id11 = $this->factory->category->create( array( 'parent' => $term_id1 ) );
+ $term_id2 = $this->factory->category->create();
+ $term_id22 = $this->factory->category->create( array( 'parent' => $term_id2 ) );
+
+ // There's something else broken in the cache cleaning routines that leads to this having to be done manually
+ delete_option( 'category_children' );
+
+ $terms = get_terms( 'category', array(
+ 'exclude' => $term_id_uncategorized,
+ 'fields' => 'ids',
+ 'hide_empty' => false,
+ ) );
+ $this->assertEquals( array( $term_id1, $term_id11, $term_id2, $term_id22 ), $terms );
+
+ $terms = get_terms( 'category', array(
+ 'fields' => 'ids',
+ 'exclude_tree' => "$term_id1,$term_id_uncategorized",
+ 'hide_empty' => false,
+ ) );
+
+ $this->assertEquals( array( $term_id2, $term_id22 ), $terms );
+
+ }
+
+ /**
* @ticket 13992
*/