From: Edward Z. Yang Date: Sun, 8 Dec 2013 01:05:09 +0000 (-0800) Subject: WordPress 3.7.1 X-Git-Tag: wordpress-3.7.1 X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/commitdiff_plain/53a5df18dd17a11c18781e78349feb3e139096b4 WordPress 3.7.1 Signed-off-by: Edward Z. Yang --- diff --git a/wp-admin/about.php b/wp-admin/about.php index a694fe54..c0ef6c60 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -21,7 +21,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

-
+
@@ -35,6 +35,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); +
+

+

Version %1$s addressed %2$s bug.', + 'Version %1$s addressed %2$s bugs.', 11 ), '3.7.1', number_format_i18n( 11 ) ); ?> + the release notes.' ), 'http://codex.wordpress.org/Version_3.7.1' ); ?> +

+
+

@@ -61,7 +69,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ); 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 ) { echo '

' . __( 'This site is able to apply these updates automatically. Cool!' ). '

'; diff --git a/wp-admin/credits.php b/wp-admin/credits.php index 059adc7c..06fe44b7 100644 --- a/wp-admin/credits.php +++ b/wp-admin/credits.php @@ -81,7 +81,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

-
+
diff --git a/wp-admin/freedoms.php b/wp-admin/freedoms.php index 2f8fce4f..672323cc 100644 --- a/wp-admin/freedoms.php +++ b/wp-admin/freedoms.php @@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );

-
+
diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 891a4e89..90b9658d 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -2135,7 +2135,7 @@ class WP_Automatic_Updater { // If the update transient is empty, use the update we just performed 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, '>' ) ); /** * Filter whether to send an email following an automatic background core update. diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 7f1e0f2c..58a9e9ba 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -60,17 +60,23 @@ function plugins_api($action, $args = null) { $res = apply_filters( 'plugins_api', false, $action, $args ); 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( '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) ) { $res = new WP_Error('plugins_api_failed', __( '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.' ), $request->get_error_message() ); diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 0e48bac8..9ea69f2f 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -282,16 +282,22 @@ function themes_api($action, $args = null) { $res = apply_filters('themes_api', false, $action, $args); //NOTE: Allows a theme to completely override the builtin WordPress.org API. 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) ) { $res = new WP_Error('themes_api_failed', __( '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.' ), $request->get_error_message() ); diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index 52ef1fd4..b841268b 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -750,7 +750,7 @@ function update_core($from, $to) { // Check to make sure everything copied correctly, ignoring the contents of wp-content $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' ) ) continue; diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 147ce4a1..feafd94b 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -103,9 +103,9 @@ function find_core_auto_update() { function get_core_checksums( $version, $locale ) { $return = array(); - $url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' ); + $url = $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), null, '&' ); - if ( wp_http_supports( array( 'ssl' ) ) ) + if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) $url = set_url_scheme( $url, 'https' ); $options = array( @@ -113,6 +113,10 @@ function get_core_checksums( $version, $locale ) { ); $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 ) ) return false; diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 99887d36..3a17482c 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -146,7 +146,7 @@ function core_upgrade_preamble() { echo '

'; _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; $future_minor_update = (object) array( diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 27b8bf22..57f7cb9a 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -232,6 +232,9 @@ function get_the_category_list( $separator = '', $parents='', $post_id = false ) * @return bool True if the current post is in any of the given categories. */ function in_category( $category, $post = null ) { + if ( empty( $category ) ) + return false; + return has_category( $category, $post ); } diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index bc6c79a8..7326d6c8 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -42,10 +42,10 @@ function wp_initial_constants() { if ( function_exists( 'memory_get_usage' ) ) { $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; if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) ) diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js index 4884c021..240d567c 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -1 +1 @@ -!function(){tinymce.create("tinymce.plugins.wpEditImage",{url:"",editor:{},init:function(a,b){var c=this,d={};c.url=b,c.editor=a,c._createButtons(),a.addCommand("WP_EditImage",c._editImage),a.onInit.add(function(a){a.dom.events.add(a.getBody(),"mousedown",function(b){var c;"IMG"==b.target.nodeName&&(c=a.dom.getParent(b.target,"div.mceTemp"))&&(tinymce.isGecko?a.selection.select(c):tinymce.isWebKit&&a.dom.events.prevent(b))}),a.dom.events.add(a.getBody(),"keydown",function(b){var c,d,e,f;return 13==b.keyCode&&(c=a.selection.getNode(),d=a.dom.getParent(c,"dl.wp-caption"),d&&(e=a.dom.getParent(d,"div.mceTemp")),e)?(a.dom.events.cancel(b),f=a.dom.create("p",{},""),a.dom.insertAfter(f,e),a.selection.setCursorLocation(f,0),!1):void 0}),"ontouchstart"in window&&a.dom.events.add(a.getBody(),"touchstart",function(a){c._showButtons(a)})}),a.onMouseUp.add(function(a,b){if(!tinymce.isWebKit&&!tinymce.isOpera){if(d.x&&(b.clientX!=d.x||b.clientY!=d.y)){var c=a.selection.getNode();"IMG"==c.nodeName&&window.setTimeout(function(){var b,e=a.dom.getParent(c,"dl.wp-caption");(c.width!=d.img_w||c.height!=d.img_h)&&(c.className=c.className.replace(/size-[^ "']+/,"")),e&&(b=a.dom.getAttrib(c,"width")||c.width,b=parseInt(b,10),a.dom.setStyle(e,"width",10+b),a.execCommand("mceRepaint"))},100)}d={}}}),a.onMouseDown.add(function(a,b){c._showButtons(b)}),a.onBeforeSetContent.add(function(a,b){b.content=a.wpSetImgCaption(b.content)}),a.onPostProcess.add(function(a,b){b.get&&(b.content=a.wpGetImgCaption(b.content))}),a.wpSetImgCaption=function(a){return c._do_shcode(a)},a.wpGetImgCaption=function(a){return c._get_shcode(a)},a.onBeforeExecCommand.add(function(a,b){var c,d;if("mceInsertContent"==b){if(c=a.dom.getParent(a.selection.getNode(),"div.mceTemp"),!c)return;d=a.dom.create("p"),a.dom.insertAfter(d,c),a.selection.setCursorLocation(d,0)}})},_do_shcode:function(a){return a.replace(/(?:

)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(a,b,c){var d,e,f,g,h,i,j=tinymce.trim;return d=b.match(/id=['"]([^'"]*)['"] ?/),d&&(b=b.replace(d[0],"")),e=b.match(/align=['"]([^'"]*)['"] ?/),e&&(b=b.replace(e[0],"")),f=b.match(/width=['"]([0-9]*)['"] ?/),f&&(b=b.replace(f[0],"")),c=j(c),i=c.match(/((?:]+>)?]+>(?:<\/a>)?)([\s\S]*)/i),i&&i[2]?(g=j(i[2]),i=j(i[1])):(g=j(b).replace(/caption=['"]/,"").replace(/['"]$/,""),i=c),d=d&&d[1]?d[1]:"",e=e&&e[1]?e[1]:"alignnone",f=f&&f[1]?f[1]:"",f&&g?(h="mceTemp","aligncenter"==e&&(h+=" mceIEcenter"),'

"):c})},_get_shcode:function(a){return a.replace(/
]*>([\s\S]+?)<\/div>/g,function(a,b){var c=b.replace(/
]+)>\s*
]+>([\s\S]+?)<\/dt>\s*
]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(a,b,c,d){var e,f,g;return g=c.match(/width="([0-9]*)"/),g=g&&g[1]?g[1]:"",g&&d?(e=b.match(/id="([^"]*)"/),e=e&&e[1]?e[1]:"",f=b.match(/class="([^"]*)"/),f=f&&f[1]?f[1]:"",f=f.match(/align[a-z]+/)||"alignnone",d=d.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),d=d.replace(/\s*\n\s*/g,"
"),'[caption id="'+e+'" align="'+f+'" width="'+g+'"]'+c+" "+d+"[/caption]"):c});return 0!==c.indexOf("[caption")&&(c=b.replace(/[\s\S]*?((?:
]+>)?]+>(?:<\/a>)?)(

[\s\S]*<\/p>)?[\s\S]*/gi,"

$1

$2")),c})},_createButtons:function(){var a,b,c,d=this,e=tinymce.activeEditor,f=tinymce.DOM;f.get("wp_editbtns")||(c=window.devicePixelRatio&&window.devicePixelRatio>1||window.matchMedia&&window.matchMedia("(min-resolution:130dpi)").matches,f.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"}),a=f.add("wp_editbtns","img",{src:c?d.url+"/img/image-2x.png":d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:e.getLang("wpeditimage.edit_img")}),tinymce.dom.Event.add(a,"mousedown",function(){d._editImage(),e.plugins.wordpress._hideButtons()}),b=f.add("wp_editbtns","img",{src:c?d.url+"/img/delete-2x.png":d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:e.getLang("wpeditimage.del_img")}),tinymce.dom.Event.add(b,"mousedown",function(){var a,b=tinymce.activeEditor,c=b.selection.getNode();return"IMG"==c.nodeName&&-1==b.dom.getAttrib(c,"class").indexOf("mceItem")?((a=b.dom.getParent(c,"div"))&&b.dom.hasClass(a,"mceTemp")?b.dom.remove(a):("A"==c.parentNode.nodeName&&1==c.parentNode.childNodes.length&&(c=c.parentNode),"P"==c.parentNode.nodeName&&1==c.parentNode.childNodes.length&&(c=c.parentNode),b.dom.remove(c)),b.execCommand("mceRepaint"),!1):(b.plugins.wordpress._hideButtons(),void 0)}))},_editImage:function(){var a,b,c,d=tinymce.activeEditor,e=this.url,f=d.selection.getNode(),g=f.className;-1==g.indexOf("mceItem")&&-1==g.indexOf("wpGallery")&&"IMG"==f.nodeName&&(a=tinymce.DOM.getViewPort(),b=680)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g,function(a,b,c){var d,e,f,g,h,i,j=tinymce.trim;return d=b.match(/id=['"]([^'"]*)['"] ?/),d&&(b=b.replace(d[0],"")),e=b.match(/align=['"]([^'"]*)['"] ?/),e&&(b=b.replace(e[0],"")),f=b.match(/width=['"]([0-9]*)['"] ?/),f&&(b=b.replace(f[0],"")),c=j(c),i=c.match(/((?:
]+>)?]+>(?:<\/a>)?)([\s\S]*)/i),i&&i[2]?(g=j(i[2]),i=j(i[1])):(g=j(b).replace(/caption=['"]/,"").replace(/['"]$/,""),i=c),d=d&&d[1]?d[1]:"",e=e&&e[1]?e[1]:"alignnone",f=f&&f[1]?f[1]:"",f&&g?(h="mceTemp","aligncenter"==e&&(h+=" mceIEcenter"),f=parseInt(f,10)+10,'
'+i+'
'+g+"
"):c})},_get_shcode:function(a){return a.replace(/
]*>([\s\S]+?)<\/div>/g,function(a,b){var c=b.replace(/
]+)>\s*
]+>([\s\S]+?)<\/dt>\s*
]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi,function(a,b,c,d){var e,f,g;return g=c.match(/width="([0-9]*)"/),g=g&&g[1]?g[1]:"",g&&d?(e=b.match(/id="([^"]*)"/),e=e&&e[1]?e[1]:"",f=b.match(/class="([^"]*)"/),f=f&&f[1]?f[1]:"",f=f.match(/align[a-z]+/)||"alignnone",d=d.replace(/\r\n|\r/g,"\n").replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),d=d.replace(/\s*\n\s*/g,"
"),'[caption id="'+e+'" align="'+f+'" width="'+g+'"]'+c+" "+d+"[/caption]"):c});return 0!==c.indexOf("[caption")&&(c=b.replace(/[\s\S]*?((?:
]+>)?]+>(?:<\/a>)?)(

[\s\S]*<\/p>)?[\s\S]*/gi,"

$1

$2")),c})},_createButtons:function(){var a,b,c,d=this,e=tinymce.activeEditor,f=tinymce.DOM;f.get("wp_editbtns")||(c=window.devicePixelRatio&&window.devicePixelRatio>1||window.matchMedia&&window.matchMedia("(min-resolution:130dpi)").matches,f.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"}),a=f.add("wp_editbtns","img",{src:c?d.url+"/img/image-2x.png":d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:e.getLang("wpeditimage.edit_img")}),tinymce.dom.Event.add(a,"mousedown",function(){d._editImage(),e.plugins.wordpress._hideButtons()}),b=f.add("wp_editbtns","img",{src:c?d.url+"/img/delete-2x.png":d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:e.getLang("wpeditimage.del_img")}),tinymce.dom.Event.add(b,"mousedown",function(){var a,b=tinymce.activeEditor,c=b.selection.getNode();return"IMG"==c.nodeName&&-1==b.dom.getAttrib(c,"class").indexOf("mceItem")?((a=b.dom.getParent(c,"div"))&&b.dom.hasClass(a,"mceTemp")?b.dom.remove(a):("A"==c.parentNode.nodeName&&1==c.parentNode.childNodes.length&&(c=c.parentNode),"P"==c.parentNode.nodeName&&1==c.parentNode.childNodes.length&&(c=c.parentNode),b.dom.remove(c)),b.execCommand("mceRepaint"),!1):(b.plugins.wordpress._hideButtons(),void 0)}))},_editImage:function(){var a,b,c,d=tinymce.activeEditor,e=this.url,f=d.selection.getNode(),g=f.className;-1==g.indexOf("mceItem")&&-1==g.indexOf("wpGallery")&&"IMG"==f.nodeName&&(a=tinymce.DOM.getViewPort(),b=680
'+img+'
'+cap+'
'; }); }, diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index 99cab128..d452a54a 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 0687ca6b..cd0ead99 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -797,9 +797,9 @@ function wp_get_pomo_file_data( $po_file ) { 'Project-Id-Version' => '"Project-Id-Version', '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; } diff --git a/wp-includes/option.php b/wp-includes/option.php index cee2451f..6f7a3a60 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -236,6 +236,7 @@ function update_option( $option, $value ) { $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 ) return false; @@ -246,7 +247,6 @@ function update_option( $option, $value ) { wp_cache_set( 'notoptions', $notoptions, 'options' ); } - do_action( 'update_option', $option, $old_value, $value ); if ( ! defined( 'WP_INSTALLING' ) ) { $alloptions = wp_load_alloptions(); if ( isset( $alloptions[$option] ) ) { diff --git a/wp-includes/post.php b/wp-includes/post.php index 39d71a37..8770b0dc 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -3706,7 +3706,7 @@ function get_pages( $args = array() ) { if ( !in_array( $post_type, $hierarchical_post_types ) ) return $pages; - if ( $parent && ! $child_of ) + if ( $parent > 0 && ! $child_of ) $hierarchical = false; // Make sure we have a valid post status diff --git a/wp-includes/query.php b/wp-includes/query.php index a9300329..93d57c2d 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1986,8 +1986,8 @@ class WP_Query { else $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; if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) ) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index c8191fe0..4bf48a93 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1362,7 +1362,7 @@ function get_terms($taxonomies, $args = '') { $exclusions = ''; 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( $excluded_children, diff --git a/wp-includes/update.php b/wp-includes/update.php index 9979ae99..bc666fd2 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -93,8 +93,8 @@ function wp_version_check( $extra_stats = array() ) { if ( $extra_stats ) $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' ); $options = array( @@ -108,6 +108,10 @@ function wp_version_check( $extra_stats = array() ) { ); $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 ) ) return false; @@ -246,11 +250,15 @@ function wp_update_plugins() { 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); - $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 ) ) return false; @@ -382,11 +390,15 @@ function wp_update_themes() { 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ); - $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 ) ) return false; diff --git a/wp-includes/user.php b/wp-includes/user.php index 9a60cd20..a0cb8d81 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -212,6 +212,8 @@ function count_many_users_posts( $users, $post_type = 'post', $public_only = fal * @return int The current user's ID */ 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 ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 5d03fc38..7aed0355 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '3.7'; +$wp_version = '3.7.1'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. @@ -18,7 +18,7 @@ $wp_db_version = 25824; * * @global string $tinymce_version */ -$tinymce_version = '359-20131018'; +$tinymce_version = '359-20131026'; /** * Holds the required PHP version