Index: tags/4.6/Gruntfile.js
===================================================================
--- tags/4.6.1/Gruntfile.js	(revision 38560)
+++ tags/4.6/Gruntfile.js	(revision 38270)
@@ -515,15 +515,6 @@
 				src: SOURCE_DIR + 'wp-admin/js/bookmarklet.js',
 				dest: SOURCE_DIR + 'wp-admin/js/bookmarklet.min.js'
-			},
-			masonry: {
-				options: {
-					// Preserve comments that start with a bang.
-					preserveComments: /^!/
-				},
-				src: SOURCE_DIR + 'wp-includes/js/jquery/jquery.masonry.js',
-				dest: SOURCE_DIR + 'wp-includes/js/jquery/jquery.masonry.min.js'
-			}
-		},
-
+			}
+		},
 		concat: {
 			tinymce: {
@@ -686,5 +677,4 @@
 		'jshint:corejs',
 		'uglify:bookmarklet',
-		'uglify:masonry',
 		'qunit:compiled'
 	] );
Index: tags/4.6/package.json
===================================================================
--- tags/4.6.1/package.json	(revision 38560)
+++ tags/4.6/package.json	(revision 38270)
@@ -1,5 +1,5 @@
 {
   "name": "WordPress",
-  "version": "4.6.1",
+  "version": "4.6.0",
   "description": "WordPress is web software you can use to create a beautiful website or blog.",
   "repository": {
Index: tags/4.6/src/readme.html
===================================================================
--- tags/4.6.1/src/readme.html	(revision 38560)
+++ tags/4.6/src/readme.html	(revision 38270)
@@ -10,5 +10,5 @@
 <h1 id="logo">
 	<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
-	<br /> Version 4.6.1
+	<br /> Version 4.6
 </h1>
 <p style="text-align: center">Semantic Personal Publishing Platform</p>
Index: tags/4.6/src/wp-admin/about.php
===================================================================
--- tags/4.6.1/src/wp-admin/about.php	(revision 38560)
+++ tags/4.6/src/wp-admin/about.php	(revision 38270)
@@ -58,12 +58,4 @@
 			<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
 		</h2>
-
-		<div class="changelog point-releases">
-			<h3><?php _e( 'Maintenance and Security Release' ); ?></h3>
-			<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
-				'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 15 ), '4.6.1', number_format_i18n( 15 ) ); ?>
-				<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.6.1' ); ?>
-			</p>
-		</div>
 
 		<div class="headline-feature feature-video">
Index: tags/4.6/src/wp-admin/includes/class-file-upload-upgrader.php
===================================================================
--- tags/4.6.1/src/wp-admin/includes/class-file-upload-upgrader.php	(revision 38560)
+++ tags/4.6/src/wp-admin/includes/class-file-upload-upgrader.php	(revision 38270)
@@ -101,10 +101,6 @@
 				wp_die( $uploads['error'] );
 
-			$this->filename = sanitize_file_name( $_GET[ $urlholder ] );
+			$this->filename = $_GET[$urlholder];
 			$this->package = $uploads['basedir'] . '/' . $this->filename;
-
-			if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {
-				wp_die( __( 'Please select a file' ) );
-			}
 		}
 	}
Index: tags/4.6/src/wp-admin/includes/class-language-pack-upgrader.php
===================================================================
--- tags/4.6.1/src/wp-admin/includes/class-language-pack-upgrader.php	(revision 38560)
+++ tags/4.6/src/wp-admin/includes/class-language-pack-upgrader.php	(revision 38270)
@@ -283,7 +283,7 @@
 		// Re-add upgrade hooks.
 		add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
-		add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 );
-		add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 );
-		add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 );
+		add_action( 'upgrader_process_complete', 'wp_version_check' );
+		add_action( 'upgrader_process_complete', 'wp_update_plugins' );
+		add_action( 'upgrader_process_complete', 'wp_update_themes' );
 
 		$this->skin->bulk_footer();
Index: tags/4.6/src/wp-admin/includes/media.php
===================================================================
--- tags/4.6.1/src/wp-admin/includes/media.php	(revision 38560)
+++ tags/4.6/src/wp-admin/includes/media.php	(revision 38270)
@@ -291,5 +291,5 @@
 	$type = $file['type'];
 	$file = $file['file'];
-	$title = sanitize_title( $name );
+	$title = $name;
 	$content = '';
 	$excerpt = '';
Index: tags/4.6/src/wp-admin/js/editor-expand.js
===================================================================
--- tags/4.6.1/src/wp-admin/js/editor-expand.js	(revision 38560)
+++ tags/4.6/src/wp-admin/js/editor-expand.js	(revision 38270)
@@ -54,45 +54,4 @@
 			};
 
-		var shrinkTextarea = window._.throttle( function() {
-			var x = window.scrollX || document.documentElement.scrollLeft;
-			var y = window.scrollY || document.documentElement.scrollTop;
-			var height = parseInt( textEditor.style.height, 10 );
-
-			textEditor.style.height = autoresizeMinHeight + 'px';
-
-			if ( textEditor.scrollHeight > autoresizeMinHeight ) {
-				textEditor.style.height = textEditor.scrollHeight + 'px';
-			}
-
-			if ( typeof x !== 'undefined' ) {
-				window.scrollTo( x, y );
-			}
-
-			if ( textEditor.scrollHeight < height ) {
-				adjust();
-			}
-		}, 300 );
-
-		function textEditorResize() {
-			var length = textEditor.value.length;
-
-			if ( mceEditor && ! mceEditor.isHidden() ) {
-				return;
-			}
-
-			if ( ! mceEditor && initialMode === 'tinymce' ) {
-				return;
-			}
-
-			if ( length < oldTextLength ) {
-				shrinkTextarea();
-			} else if ( parseInt( textEditor.style.height, 10 ) < textEditor.scrollHeight ) {
-				textEditor.style.height = Math.ceil( textEditor.scrollHeight ) + 'px';
-				adjust();
-			}
-
-			oldTextLength = length;
-		}
-
 		function getHeights() {
 			var windowWidth = $window.width();
@@ -115,4 +74,41 @@
 				heights.menuBarHeight = 0;
 			}
+		}
+
+		function textEditorResize() {
+			if ( mceEditor && ! mceEditor.isHidden() ) {
+				return;
+			}
+
+			if ( ! mceEditor && initialMode === 'tinymce' ) {
+				return;
+			}
+
+			var length = textEditor.value.length;
+			var height = parseInt( textEditor.style.height, 10 );
+			var top = window.scrollTop;
+
+			if ( length < oldTextLength ) {
+				// textEditor.scrollHeight is not adjusted until the next line.
+				textEditor.style.height = 'auto';
+
+				if ( textEditor.scrollHeight > autoresizeMinHeight ) {
+					textEditor.style.height = textEditor.scrollHeight + 'px';
+				} else {
+					textEditor.style.height = autoresizeMinHeight + 'px';
+				}
+
+				// Prevent scroll-jumping in Firefox and IE.
+				window.scrollTop = top;
+
+				if ( textEditor.scrollHeight < height ) {
+					adjust();
+				}
+			} else if ( height < textEditor.scrollHeight ) {
+				textEditor.style.height = textEditor.scrollHeight + 'px';
+				adjust();
+			}
+
+			oldTextLength = length;
 		}
 
Index: tags/4.6/src/wp-includes/Requests/Transport/cURL.php
===================================================================
--- tags/4.6.1/src/wp-includes/Requests/Transport/cURL.php	(revision 38560)
+++ tags/4.6/src/wp-includes/Requests/Transport/cURL.php	(revision 38270)
@@ -348,5 +348,5 @@
 				curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']);
 				if (!empty($data)) {
-					curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data);
+					curl_setopt( $this->handle, CURLOPT_POSTFIELDS, $data );
 				}
 		}
@@ -525,5 +525,5 @@
 	 */
 	public static function test($capabilities = array()) {
-		if (!function_exists('curl_init') || !function_exists('curl_exec')) {
+		if (!function_exists('curl_init') && !function_exists('curl_exec')) {
 			return false;
 		}
Index: tags/4.6/src/wp-includes/class-http.php
===================================================================
--- tags/4.6.1/src/wp-includes/class-http.php	(revision 38560)
+++ tags/4.6/src/wp-includes/class-http.php	(revision 38270)
@@ -363,7 +363,4 @@
 		}
 
-		// Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231
-		$url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url );
-
 		try {
 			$requests_response = Requests::request( $url, $headers, $data, $type, $options );
@@ -437,5 +434,5 @@
 			if ( $value instanceof WP_Http_Cookie ) {
 				$cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() );
-			} elseif ( is_scalar( $value ) ) {
+			} elseif ( is_string( $value ) ) {
 				$cookie_jar[ $name ] = new Requests_Cookie( $name, $value );
 			}
Index: tags/4.6/src/wp-includes/class-wp-editor.php
===================================================================
--- tags/4.6.1/src/wp-includes/class-wp-editor.php	(revision 38560)
+++ tags/4.6/src/wp-includes/class-wp-editor.php	(revision 38270)
@@ -1260,12 +1260,4 @@
 
 			if ( typeof tinymce !== 'undefined' ) {
-				// Fix RTL
-				tinymce.on( 'addeditor', function( event ) {
-					event.editor.rtl = event.editor.settings.rtl_ui ||
-						( event.editor.editorManager &&
-						event.editor.editorManager.i18n &&
-						event.editor.editorManager.i18n.rtl );
-				}, true );
-
 				for ( id in tinyMCEPreInit.mceInit ) {
 					init = tinyMCEPreInit.mceInit[id];
Index: tags/4.6/src/wp-includes/css/editor.css
===================================================================
--- tags/4.6.1/src/wp-includes/css/editor.css	(revision 38560)
+++ tags/4.6/src/wp-includes/css/editor.css	(revision 38270)
@@ -391,9 +391,4 @@
 	text-shadow: none;
 	cursor: pointer;
-}
-
-.mce-btn .mce-txt {
-	direction: inherit;
-	text-align: inherit;
 }
 
Index: tags/4.6/src/wp-includes/functions.php
===================================================================
--- tags/4.6.1/src/wp-includes/functions.php	(revision 38560)
+++ tags/4.6/src/wp-includes/functions.php	(revision 38270)
@@ -3191,27 +3191,26 @@
  * plugin, and adds the 'ltr' button to 'toolbar1', formerly
  * 'theme_advanced_buttons1' array keys. These keys are then returned
- * in the $mce_init (TinyMCE settings) array.
+ * in the $input (TinyMCE settings) array.
  *
  * @since 2.1.0
  * @access private
  *
- * @param array $mce_init MCE settings array.
+ * @param array $input MCE settings array.
  * @return array Direction set for 'rtl', if needed by locale.
  */
-function _mce_set_direction( $mce_init ) {
+function _mce_set_direction( $input ) {
 	if ( is_rtl() ) {
-		$mce_init['directionality'] = 'rtl';
-		$mce_init['rtl_ui'] = true;
-
-		if ( ! empty( $mce_init['plugins'] ) && strpos( $mce_init['plugins'], 'directionality' ) === false ) {
-			$mce_init['plugins'] .= ',directionality';
-		}
-
-		if ( ! empty( $mce_init['toolbar1'] ) && ! preg_match( '/\bltr\b/', $mce_init['toolbar1'] ) ) {
-			$mce_init['toolbar1'] .= ',ltr';
-		}
-	}
-
-	return $mce_init;
+		$input['directionality'] = 'rtl';
+
+		if ( ! empty( $input['plugins'] ) && strpos( $input['plugins'], 'directionality' ) === false ) {
+			$input['plugins'] .= ',directionality';
+		}
+
+		if ( ! empty( $input['toolbar1'] ) && ! preg_match( '/\bltr\b/', $input['toolbar1'] ) ) {
+			$input['toolbar1'] .= ',ltr';
+		}
+	}
+
+	return $input;
 }
 
Index: tags/4.6/src/wp-includes/general-template.php
===================================================================
--- tags/4.6.1/src/wp-includes/general-template.php	(revision 38560)
+++ tags/4.6/src/wp-includes/general-template.php	(revision 38270)
@@ -2854,5 +2854,5 @@
 
 		foreach ( $urls as $url ) {
-			printf( "<link rel='%s' href='%s' />\n", $relation_type, $url );
+			printf( "<link rel='%s' href='%s'>\n", $relation_type, $url );
 		}
 	}
Index: tags/4.6/src/wp-includes/js/jquery/jquery.masonry.min.js
===================================================================
--- tags/4.6.1/src/wp-includes/js/jquery/jquery.masonry.min.js	(revision 38560)
+++ tags/4.6/src/wp-includes/js/jquery/jquery.masonry.min.js	(revision 38270)
@@ -1,11 +1,11 @@
-/*!
- * Masonry v2 shim
- * to maintain backwards compatibility
- * as of Masonry v3.1.2
- *
- * Cascading grid layout library
- * http://masonry.desandro.com
- * MIT License
- * by David DeSandro
- */
-!function(a){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?this.options.transitionDuration:0),void 0===a||a){var b=this.options.animationOptions,c=b&&b.duration;c&&(this.options.transitionDuration="string"==typeof c?c:c+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window);
+-/*!
+- * Masonry v2 shim
+- * to maintain backwards compatibility
+- * as of Masonry v3.1.2
+- *
+- * Cascading grid layout library
+- * http://masonry.desandro.com
+- * MIT License
+- * by David DeSandro
+- */
+!function(a){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?b.prototype.options.transitionDuration:0),void 0===a||a){var c=this.options.animationOptions,d=c&&c.duration;d&&(this.options.transitionDuration="string"==typeof d?d:d+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window);
Index: tags/4.6/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
===================================================================
--- tags/4.6.1/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(revision 38560)
+++ tags/4.6/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css	(revision 38270)
@@ -21,6 +21,5 @@
 }
 
-body.locale-he-il,
-body.locale-vi {
+body.locale-he-il {
 	font-family: Arial, "Times New Roman", "Bitstream Charter", Times, serif;
 }
Index: tags/4.6/src/wp-includes/load.php
===================================================================
--- tags/4.6.1/src/wp-includes/load.php	(revision 38560)
+++ tags/4.6/src/wp-includes/load.php	(revision 38270)
@@ -1018,10 +1018,6 @@
 
 	if ( ! isset( $ini_all ) ) {
-		$ini_all = false;
-		// Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes".
-		if ( function_exists( 'ini_get_all' ) ) {
-			$ini_all = ini_get_all();
-		}
- 	}
+		$ini_all = ini_get_all();
+	}
 
 	// Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
@@ -1030,9 +1026,4 @@
 	}
 
-	// If we were unable to retrieve the details, fail gracefully to assume it's changeable.
-	if ( ! is_array( $ini_all ) ) {
-		return true;
-	}
-
 	return false;
 }
Index: tags/4.6/src/wp-includes/pluggable.php
===================================================================
--- tags/4.6.1/src/wp-includes/pluggable.php	(revision 38560)
+++ tags/4.6/src/wp-includes/pluggable.php	(revision 38270)
@@ -350,5 +350,5 @@
 	$from_name = apply_filters( 'wp_mail_from_name', $from_name );
 
-	$phpmailer->setFrom( $from_email, $from_name, false );
+	$phpmailer->setFrom( $from_email, $from_name );
 
 	// Set destination addresses
Index: tags/4.6/src/wp-includes/revision.php
===================================================================
--- tags/4.6.1/src/wp-includes/revision.php	(revision 38560)
+++ tags/4.6/src/wp-includes/revision.php	(revision 38270)
@@ -595,11 +595,5 @@
 	}
 
-	if ( empty( $_REQUEST['_thumbnail_id'] ) ||
-	     empty( $_REQUEST['preview_id'] ) ||
-	     $post->ID != $post_id ||
-	     '_thumbnail_id' != $meta_key ||
-	     'revision' == $post->post_type ||
-	     $post_id != $_REQUEST['preview_id']
-	) {
+	if ( empty( $_REQUEST['_thumbnail_id'] ) || $post->ID != $post_id || '_thumbnail_id' != $meta_key || 'revision' == $post->post_type ) {
 		return $value;
 	}
Index: tags/4.6/src/wp-includes/script-loader.php
===================================================================
--- tags/4.6.1/src/wp-includes/script-loader.php	(revision 38560)
+++ tags/4.6/src/wp-includes/script-loader.php	(revision 38270)
@@ -251,5 +251,5 @@
 	$scripts->add( 'imagesloaded', "/wp-includes/js/imagesloaded.min.js", array(), '3.2.0', 1 );
 	$scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array( 'imagesloaded' ), '3.3.2', 1 );
-	$scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2b', 1 );
+	$scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2a', 1 );
 
 	$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1 );
@@ -564,5 +564,5 @@
 		) );
 
-		$scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery', 'underscore' ), false, 1 );
+		$scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery' ), false, 1 );
 
 		$scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 );
Index: tags/4.6/src/wp-includes/taxonomy.php
===================================================================
--- tags/4.6.1/src/wp-includes/taxonomy.php	(revision 38560)
+++ tags/4.6/src/wp-includes/taxonomy.php	(revision 38270)
@@ -4275,8 +4275,4 @@
 	if ( false === $object_terms ) {
 		$object_terms = wp_get_object_terms( $object_id, $taxonomy, array( 'update_term_meta_cache' => false ) );
-		if ( is_wp_error( $object_terms ) ) {
-			return $object_terms;
-		}
-
 		wp_cache_set( $object_id, wp_list_pluck( $object_terms, 'term_id' ), "{$taxonomy}_relationships" );
 	}
Index: tags/4.6/src/wp-includes/version.php
===================================================================
--- tags/4.6.1/src/wp-includes/version.php	(revision 38560)
+++ tags/4.6/src/wp-includes/version.php	(revision 38270)
@@ -5,5 +5,5 @@
  * @global string $wp_version
  */
-$wp_version = '4.6.1-src';
+$wp_version = '4.6-src';
 
 /**
Index: tags/4.6/src/wp-includes/wp-db.php
===================================================================
--- tags/4.6.1/src/wp-includes/wp-db.php	(revision 38560)
+++ tags/4.6/src/wp-includes/wp-db.php	(revision 38270)
@@ -735,7 +735,4 @@
 	 */
 	public function init_charset() {
-		$charset = '';
-		$collate = '';
-
 		if ( function_exists('is_multisite') && is_multisite() ) {
 			$charset = 'utf8';
@@ -812,27 +809,20 @@
 			$collate = $this->collate;
 		if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) {
-			$set_charset_succeeded = true;
-
 			if ( $this->use_mysqli ) {
 				if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
-					$set_charset_succeeded = mysqli_set_charset( $dbh, $charset );
+					mysqli_set_charset( $dbh, $charset );
 				}
-
-				if ( $set_charset_succeeded ) {
-					$query = $this->prepare( 'SET NAMES %s', $charset );
-					if ( ! empty( $collate ) )
-						$query .= $this->prepare( ' COLLATE %s', $collate );
-					mysqli_query( $dbh, $query );
-				}
+				$query = $this->prepare( 'SET NAMES %s', $charset );
+				if ( ! empty( $collate ) )
+					$query .= $this->prepare( ' COLLATE %s', $collate );
+				mysqli_query( $dbh, $query );
 			} else {
 				if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
-					$set_charset_succeeded = mysql_set_charset( $charset, $dbh );
+					mysql_set_charset( $charset, $dbh );
 				}
-				if ( $set_charset_succeeded ) {
-					$query = $this->prepare( 'SET NAMES %s', $charset );
-					if ( ! empty( $collate ) )
-						$query .= $this->prepare( ' COLLATE %s', $collate );
-					mysql_query( $query, $dbh );
-				}
+				$query = $this->prepare( 'SET NAMES %s', $charset );
+				if ( ! empty( $collate ) )
+					$query .= $this->prepare( ' COLLATE %s', $collate );
+				mysql_query( $query, $dbh );
 			}
 		}
Index: tags/4.6/tests/phpunit/tests/general/resourceHints.php
===================================================================
--- tags/4.6.1/tests/phpunit/tests/general/resourceHints.php	(revision 38560)
+++ tags/4.6/tests/phpunit/tests/general/resourceHints.php	(revision 38270)
@@ -32,5 +32,5 @@
 
 	function test_should_have_defaults_on_frontend() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n";
 
 		$this->expectOutputString( $expected );
@@ -40,8 +40,8 @@
 
 	function test_dns_prefetching() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" .
-					"<link rel='dns-prefetch' href='//wordpress.org' />\n" .
-					"<link rel='dns-prefetch' href='//google.com' />\n" .
-					"<link rel='dns-prefetch' href='//make.wordpress.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n" .
+					"<link rel='dns-prefetch' href='//wordpress.org'>\n" .
+					"<link rel='dns-prefetch' href='//google.com'>\n" .
+					"<link rel='dns-prefetch' href='//make.wordpress.org'>\n";
 
 		add_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_domains' ), 10, 2 );
@@ -71,9 +71,9 @@
 	 */
 	function test_preconnect() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" .
-		            "<link rel='preconnect' href='//wordpress.org' />\n" .
-		            "<link rel='preconnect' href='https://make.wordpress.org' />\n" .
-		            "<link rel='preconnect' href='http://google.com' />\n" .
-		            "<link rel='preconnect' href='http://w.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n" .
+		            "<link rel='preconnect' href='//wordpress.org'>\n" .
+		            "<link rel='preconnect' href='https://make.wordpress.org'>\n" .
+		            "<link rel='preconnect' href='http://google.com'>\n" .
+		            "<link rel='preconnect' href='http://w.org'>\n";
 
 		add_filter( 'wp_resource_hints', array( $this, '_add_preconnect_domains' ), 10, 2 );
@@ -99,8 +99,8 @@
 
 	function test_prerender() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" .
-					"<link rel='prerender' href='https://make.wordpress.org/great-again' />\n" .
-					"<link rel='prerender' href='http://jobs.wordpress.net' />\n" .
-					"<link rel='prerender' href='//core.trac.wordpress.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n" .
+					"<link rel='prerender' href='https://make.wordpress.org/great-again'>\n" .
+					"<link rel='prerender' href='http://jobs.wordpress.net'>\n" .
+					"<link rel='prerender' href='//core.trac.wordpress.org'>\n";
 
 		add_filter( 'wp_resource_hints', array( $this, '_add_prerender_urls' ), 10, 2 );
@@ -125,6 +125,6 @@
 
 	function test_parse_url_dns_prefetch() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" .
-					"<link rel='dns-prefetch' href='//make.wordpress.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n" .
+					"<link rel='dns-prefetch' href='//make.wordpress.org'>\n";
 
 		add_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_long_urls' ), 10, 2 );
@@ -146,6 +146,6 @@
 
 	function test_dns_prefetch_styles() {
-		$expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' />\n" .
-					"<link rel='dns-prefetch' href='//s.w.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com'>\n" .
+					"<link rel='dns-prefetch' href='//s.w.org'>\n";
 
 		$args = array(
@@ -165,6 +165,6 @@
 
 	function test_dns_prefetch_scripts() {
-		$expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' />\n" .
-					"<link rel='dns-prefetch' href='//s.w.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com'>\n" .
+					"<link rel='dns-prefetch' href='//s.w.org'>\n";
 
 		$args = array(
@@ -183,6 +183,6 @@
 
 	function test_dns_prefetch_scripts_does_not_included_registered_only() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n";
-		$unexpected = "<link rel='dns-prefetch' href='//wordpress.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n";
+		$unexpected = "<link rel='dns-prefetch' href='//wordpress.org'>\n";
 
 		wp_register_script( 'jquery-elsewhere', 'https://wordpress.org/wp-includes/js/jquery/jquery.js' );
@@ -200,5 +200,5 @@
 	 */
 	function test_deregistered_scripts_are_ignored() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n";
 
 		wp_enqueue_script( 'test-script', 'http://example.org/script.js' );
@@ -213,5 +213,5 @@
 	 */
 	function test_malformed_urls() {
-		$expected = "<link rel='dns-prefetch' href='//s.w.org' />\n";
+		$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n";
 
 		// Errant colon.
Index: tags/4.6/tests/phpunit/tests/http/base.php
===================================================================
--- tags/4.6.1/tests/phpunit/tests/http/base.php	(revision 38560)
+++ tags/4.6/tests/phpunit/tests/http/base.php	(revision 38270)
@@ -377,17 +377,4 @@
 	}
 
-	/**
-	 * @ticket 37733
-	 */
-	function test_url_with_double_slashes_path() {
-		$url = $this->redirection_script . '?rt=' . 0;
-
-		$path = parse_url( $url, PHP_URL_PATH );
-		$url = str_replace( $path, '/' . $path, $url );
-
-		$res = wp_remote_request( $url );
-		$this->assertNotWPError( $res );
-	}
-
 
 }
Index: tags/4.6/tests/phpunit/tests/http/http.php
===================================================================
--- tags/4.6.1/tests/phpunit/tests/http/http.php	(revision 38560)
+++ tags/4.6/tests/phpunit/tests/http/http.php	(revision 38270)
@@ -119,34 +119,3 @@
 
 	}
-
-	/**
-	 * @ticket 37768
-	 */
-	public function test_normalize_cookies_scalar_values() {
-		$http = _wp_http_get_object();
-
-		$cookies = array(
-			'x'   => 'foo',
-			'y'   => 2,
-			'z'   => 0.45,
-			'foo' => array( 'bar' ),
-		);
-
-		$cookie_jar = $http->normalize_cookies( array(
-			'x'   => 'foo',
-			'y'   => 2,
-			'z'   => 0.45,
-			'foo' => array( 'bar' ),
-		) );
-
-		$this->assertInstanceOf( 'Requests_Cookie_Jar', $cookie_jar );
-
-		foreach( array_keys( $cookies ) as $cookie ) {
-			if ( 'foo' === $cookie ) {
-				$this->assertFalse( isset( $cookie_jar[ $cookie ] ) );
-			} else {
-				$this->assertInstanceOf( 'Requests_Cookie', $cookie_jar[ $cookie ] );
-			}
-		}
-	}
 }
Index: tags/4.6/tests/phpunit/tests/mail.php
===================================================================
--- tags/4.6.1/tests/phpunit/tests/mail.php	(revision 38560)
+++ tags/4.6/tests/phpunit/tests/mail.php	(revision 38270)
@@ -343,21 +343,3 @@
 		}
 	}
-
-	/**
-	 * Test that the Sender field in the SMTP envelope is not set by Core.
-	 *
-	 * Correctly setting the Sender requires knowledge that is not available
-	 * to Core. An incorrect value will often lead to messages being rejected
-	 * by the receiving MTA, so it's the admin's responsibility to
-	 * set it correctly.
-	 *
-	 * @ticket 37736
-	 */
-	public function test_wp_mail_sender_not_set() {
-		wp_mail( 'user@example.org', 'Testing the Sender field', 'The Sender field should not have been set.' );
-
-		$mailer = tests_retrieve_phpmailer_instance();
-
-		$this->assertEquals( '', $mailer->Sender );
-	}
 }
Index: tags/4.6/tests/phpunit/tests/post/thumbnails.php
===================================================================
--- tags/4.6.1/tests/phpunit/tests/post/thumbnails.php	(revision 38560)
+++ tags/4.6/tests/phpunit/tests/post/thumbnails.php	(revision 38270)
@@ -243,39 +243,14 @@
 		$GLOBALS['post'] = self::$post;
 		$_REQUEST['_thumbnail_id'] = self::$attachment_id;
-		$_REQUEST['preview_id'] = self::$post->ID;
 
 		$result = _wp_preview_post_thumbnail_filter( '', self::$post->ID, '_thumbnail_id' );
-
-		// Clean up.
-		$GLOBALS['post'] = $old_post;
+		$this->assertEquals( self::$attachment_id, $result );
+
 		unset( $_REQUEST['_thumbnail_id'] );
-		unset( $_REQUEST['preview_id'] );
-
-		$this->assertEquals( self::$attachment_id, $result );
-	}
-
-	/**
-	 * @ticket 37697
-	 */
-	function test__wp_preview_post_thumbnail_filter_secondary_post() {
-		$old_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null;
-
-		$secondary_post = self::factory()->post->create( array(
-				'post_stauts' => 'publish',
-			)
-		);
-
-		$GLOBALS['post'] = self::$post;
-		$_REQUEST['_thumbnail_id'] = self::$attachment_id;
-		$_REQUEST['preview_id'] = $secondary_post;
-
-		$result = _wp_preview_post_thumbnail_filter( '', self::$post->ID, '_thumbnail_id' );
-
-		// Clean up.
-		$GLOBALS['post'] = $old_post;
-		unset( $_REQUEST['_thumbnail_id'] );
-		unset( $_REQUEST['preview_id'] );
-
-		$this->assertEmpty( $result );
+		if ( null === $old_post ) {
+			unset( $GLOBALS['post'] );
+		} else {
+			$GLOBALS['post'] = $old_post;
+		}
 	}
 
Index: tags/4.6/tests/phpunit/tests/term/isObjectInTerm.php
===================================================================
--- tags/4.6.1/tests/phpunit/tests/term/isObjectInTerm.php	(revision 38560)
+++ tags/4.6/tests/phpunit/tests/term/isObjectInTerm.php	(revision 38270)
@@ -147,10 +147,3 @@
 		$this->assertSame( $num_queries, $wpdb->num_queries );
 	}
-
-	/**
-	 * @ticket 37721
-	 */
-	public function test_invalid_taxonomy_should_return_wp_error_object() {
-		$this->assertWPError( is_object_in_term( 12345, 'foo', 'bar' ) );
-	}
 }
