Changes from tags/4.6 at r38270 to tags/4.6.1 at r38560
- Location:
- tags/4.6.1
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/4.6.1/Gruntfile.js
r38270 r38560 515 515 src: SOURCE_DIR + 'wp-admin/js/bookmarklet.js', 516 516 dest: SOURCE_DIR + 'wp-admin/js/bookmarklet.min.js' 517 } 518 }, 517 }, 518 masonry: { 519 options: { 520 // Preserve comments that start with a bang. 521 preserveComments: /^!/ 522 }, 523 src: SOURCE_DIR + 'wp-includes/js/jquery/jquery.masonry.js', 524 dest: SOURCE_DIR + 'wp-includes/js/jquery/jquery.masonry.min.js' 525 } 526 }, 527 519 528 concat: { 520 529 tinymce: { … … 677 686 'jshint:corejs', 678 687 'uglify:bookmarklet', 688 'uglify:masonry', 679 689 'qunit:compiled' 680 690 ] ); -
tags/4.6.1/package.json
r38270 r38560 1 1 { 2 2 "name": "WordPress", 3 "version": "4.6. 0",3 "version": "4.6.1", 4 4 "description": "WordPress is web software you can use to create a beautiful website or blog.", 5 5 "repository": { -
tags/4.6.1/src/readme.html
r38270 r38560 10 10 <h1 id="logo"> 11 11 <a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a> 12 <br /> Version 4.6 12 <br /> Version 4.6.1 13 13 </h1> 14 14 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
tags/4.6.1/src/wp-admin/about.php
r38270 r38560 58 58 <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> 59 59 </h2> 60 61 <div class="changelog point-releases"> 62 <h3><?php _e( 'Maintenance and Security Release' ); ?></h3> 63 <p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.', 64 '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 15 ), '4.6.1', number_format_i18n( 15 ) ); ?> 65 <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.6.1' ); ?> 66 </p> 67 </div> 60 68 61 69 <div class="headline-feature feature-video"> -
tags/4.6.1/src/wp-admin/includes/class-file-upload-upgrader.php
r38270 r38560 101 101 wp_die( $uploads['error'] ); 102 102 103 $this->filename = $_GET[$urlholder];103 $this->filename = sanitize_file_name( $_GET[ $urlholder ] ); 104 104 $this->package = $uploads['basedir'] . '/' . $this->filename; 105 106 if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) { 107 wp_die( __( 'Please select a file' ) ); 108 } 105 109 } 106 110 } -
tags/4.6.1/src/wp-admin/includes/class-language-pack-upgrader.php
r38270 r38560 283 283 // Re-add upgrade hooks. 284 284 add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); 285 add_action( 'upgrader_process_complete', 'wp_version_check' );286 add_action( 'upgrader_process_complete', 'wp_update_plugins' );287 add_action( 'upgrader_process_complete', 'wp_update_themes' );285 add_action( 'upgrader_process_complete', 'wp_version_check', 10, 0 ); 286 add_action( 'upgrader_process_complete', 'wp_update_plugins', 10, 0 ); 287 add_action( 'upgrader_process_complete', 'wp_update_themes', 10, 0 ); 288 288 289 289 $this->skin->bulk_footer(); -
tags/4.6.1/src/wp-admin/includes/media.php
r38270 r38560 291 291 $type = $file['type']; 292 292 $file = $file['file']; 293 $title = $name;293 $title = sanitize_title( $name ); 294 294 $content = ''; 295 295 $excerpt = ''; -
tags/4.6.1/src/wp-admin/js/editor-expand.js
r38270 r38560 54 54 }; 55 55 56 var shrinkTextarea = window._.throttle( function() { 57 var x = window.scrollX || document.documentElement.scrollLeft; 58 var y = window.scrollY || document.documentElement.scrollTop; 59 var height = parseInt( textEditor.style.height, 10 ); 60 61 textEditor.style.height = autoresizeMinHeight + 'px'; 62 63 if ( textEditor.scrollHeight > autoresizeMinHeight ) { 64 textEditor.style.height = textEditor.scrollHeight + 'px'; 65 } 66 67 if ( typeof x !== 'undefined' ) { 68 window.scrollTo( x, y ); 69 } 70 71 if ( textEditor.scrollHeight < height ) { 72 adjust(); 73 } 74 }, 300 ); 75 76 function textEditorResize() { 77 var length = textEditor.value.length; 78 79 if ( mceEditor && ! mceEditor.isHidden() ) { 80 return; 81 } 82 83 if ( ! mceEditor && initialMode === 'tinymce' ) { 84 return; 85 } 86 87 if ( length < oldTextLength ) { 88 shrinkTextarea(); 89 } else if ( parseInt( textEditor.style.height, 10 ) < textEditor.scrollHeight ) { 90 textEditor.style.height = Math.ceil( textEditor.scrollHeight ) + 'px'; 91 adjust(); 92 } 93 94 oldTextLength = length; 95 } 96 56 97 function getHeights() { 57 98 var windowWidth = $window.width(); … … 74 115 heights.menuBarHeight = 0; 75 116 } 76 }77 78 function textEditorResize() {79 if ( mceEditor && ! mceEditor.isHidden() ) {80 return;81 }82 83 if ( ! mceEditor && initialMode === 'tinymce' ) {84 return;85 }86 87 var length = textEditor.value.length;88 var height = parseInt( textEditor.style.height, 10 );89 var top = window.scrollTop;90 91 if ( length < oldTextLength ) {92 // textEditor.scrollHeight is not adjusted until the next line.93 textEditor.style.height = 'auto';94 95 if ( textEditor.scrollHeight > autoresizeMinHeight ) {96 textEditor.style.height = textEditor.scrollHeight + 'px';97 } else {98 textEditor.style.height = autoresizeMinHeight + 'px';99 }100 101 // Prevent scroll-jumping in Firefox and IE.102 window.scrollTop = top;103 104 if ( textEditor.scrollHeight < height ) {105 adjust();106 }107 } else if ( height < textEditor.scrollHeight ) {108 textEditor.style.height = textEditor.scrollHeight + 'px';109 adjust();110 }111 112 oldTextLength = length;113 117 } 114 118 -
tags/4.6.1/src/wp-includes/Requests/Transport/cURL.php
r38270 r38560 348 348 curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']); 349 349 if (!empty($data)) { 350 curl_setopt( $this->handle, CURLOPT_POSTFIELDS, $data);350 curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data); 351 351 } 352 352 } … … 525 525 */ 526 526 public static function test($capabilities = array()) { 527 if (!function_exists('curl_init') &&!function_exists('curl_exec')) {527 if (!function_exists('curl_init') || !function_exists('curl_exec')) { 528 528 return false; 529 529 } -
tags/4.6.1/src/wp-includes/class-http.php
r38270 r38560 363 363 } 364 364 365 // Work around a bug in Requests when the path starts with // See https://github.com/rmccue/Requests/issues/231 366 $url = preg_replace( '!^(\w+://[^/]+)//(.*)$!i', '$1/$2', $url ); 367 365 368 try { 366 369 $requests_response = Requests::request( $url, $headers, $data, $type, $options ); … … 434 437 if ( $value instanceof WP_Http_Cookie ) { 435 438 $cookie_jar[ $value->name ] = new Requests_Cookie( $value->name, $value->value, $value->get_attributes() ); 436 } elseif ( is_s tring( $value ) ) {439 } elseif ( is_scalar( $value ) ) { 437 440 $cookie_jar[ $name ] = new Requests_Cookie( $name, $value ); 438 441 } -
tags/4.6.1/src/wp-includes/class-wp-editor.php
r38270 r38560 1260 1260 1261 1261 if ( typeof tinymce !== 'undefined' ) { 1262 // Fix RTL 1263 tinymce.on( 'addeditor', function( event ) { 1264 event.editor.rtl = event.editor.settings.rtl_ui || 1265 ( event.editor.editorManager && 1266 event.editor.editorManager.i18n && 1267 event.editor.editorManager.i18n.rtl ); 1268 }, true ); 1269 1262 1270 for ( id in tinyMCEPreInit.mceInit ) { 1263 1271 init = tinyMCEPreInit.mceInit[id]; -
tags/4.6.1/src/wp-includes/css/editor.css
r38270 r38560 391 391 text-shadow: none; 392 392 cursor: pointer; 393 } 394 395 .mce-btn .mce-txt { 396 direction: inherit; 397 text-align: inherit; 393 398 } 394 399 -
tags/4.6.1/src/wp-includes/functions.php
r38270 r38560 3191 3191 * plugin, and adds the 'ltr' button to 'toolbar1', formerly 3192 3192 * 'theme_advanced_buttons1' array keys. These keys are then returned 3193 * in the $ input (TinyMCE settings) array.3193 * in the $mce_init (TinyMCE settings) array. 3194 3194 * 3195 3195 * @since 2.1.0 3196 3196 * @access private 3197 3197 * 3198 * @param array $ input MCE settings array.3198 * @param array $mce_init MCE settings array. 3199 3199 * @return array Direction set for 'rtl', if needed by locale. 3200 3200 */ 3201 function _mce_set_direction( $ input ) {3201 function _mce_set_direction( $mce_init ) { 3202 3202 if ( is_rtl() ) { 3203 $input['directionality'] = 'rtl'; 3204 3205 if ( ! empty( $input['plugins'] ) && strpos( $input['plugins'], 'directionality' ) === false ) { 3206 $input['plugins'] .= ',directionality'; 3207 } 3208 3209 if ( ! empty( $input['toolbar1'] ) && ! preg_match( '/\bltr\b/', $input['toolbar1'] ) ) { 3210 $input['toolbar1'] .= ',ltr'; 3211 } 3212 } 3213 3214 return $input; 3203 $mce_init['directionality'] = 'rtl'; 3204 $mce_init['rtl_ui'] = true; 3205 3206 if ( ! empty( $mce_init['plugins'] ) && strpos( $mce_init['plugins'], 'directionality' ) === false ) { 3207 $mce_init['plugins'] .= ',directionality'; 3208 } 3209 3210 if ( ! empty( $mce_init['toolbar1'] ) && ! preg_match( '/\bltr\b/', $mce_init['toolbar1'] ) ) { 3211 $mce_init['toolbar1'] .= ',ltr'; 3212 } 3213 } 3214 3215 return $mce_init; 3215 3216 } 3216 3217 -
tags/4.6.1/src/wp-includes/general-template.php
r38270 r38560 2854 2854 2855 2855 foreach ( $urls as $url ) { 2856 printf( "<link rel='%s' href='%s' >\n", $relation_type, $url );2856 printf( "<link rel='%s' href='%s' />\n", $relation_type, $url ); 2857 2857 } 2858 2858 } -
tags/4.6.1/src/wp-includes/js/jquery/jquery.masonry.min.js
r38270 r38560 1 -/*!2 -* Masonry v2 shim3 -* to maintain backwards compatibility4 -* as of Masonry v3.1.25 -*6 -* Cascading grid layout library7 -* http://masonry.desandro.com8 -* MIT License9 -* by David DeSandro10 -*/11 !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);1 /*! 2 * Masonry v2 shim 3 * to maintain backwards compatibility 4 * as of Masonry v3.1.2 5 * 6 * Cascading grid layout library 7 * http://masonry.desandro.com 8 * MIT License 9 * by David DeSandro 10 */ 11 !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); -
tags/4.6.1/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
r38270 r38560 21 21 } 22 22 23 body.locale-he-il { 23 body.locale-he-il, 24 body.locale-vi { 24 25 font-family: Arial, "Times New Roman", "Bitstream Charter", Times, serif; 25 26 } -
tags/4.6.1/src/wp-includes/load.php
r38270 r38560 1018 1018 1019 1019 if ( ! isset( $ini_all ) ) { 1020 $ini_all = ini_get_all(); 1021 } 1020 $ini_all = false; 1021 // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes". 1022 if ( function_exists( 'ini_get_all' ) ) { 1023 $ini_all = ini_get_all(); 1024 } 1025 } 1022 1026 1023 1027 // 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. … … 1026 1030 } 1027 1031 1032 // If we were unable to retrieve the details, fail gracefully to assume it's changeable. 1033 if ( ! is_array( $ini_all ) ) { 1034 return true; 1035 } 1036 1028 1037 return false; 1029 1038 } -
tags/4.6.1/src/wp-includes/pluggable.php
r38270 r38560 350 350 $from_name = apply_filters( 'wp_mail_from_name', $from_name ); 351 351 352 $phpmailer->setFrom( $from_email, $from_name );352 $phpmailer->setFrom( $from_email, $from_name, false ); 353 353 354 354 // Set destination addresses -
tags/4.6.1/src/wp-includes/revision.php
r38270 r38560 595 595 } 596 596 597 if ( empty( $_REQUEST['_thumbnail_id'] ) || $post->ID != $post_id || '_thumbnail_id' != $meta_key || 'revision' == $post->post_type ) { 597 if ( empty( $_REQUEST['_thumbnail_id'] ) || 598 empty( $_REQUEST['preview_id'] ) || 599 $post->ID != $post_id || 600 '_thumbnail_id' != $meta_key || 601 'revision' == $post->post_type || 602 $post_id != $_REQUEST['preview_id'] 603 ) { 598 604 return $value; 599 605 } -
tags/4.6.1/src/wp-includes/script-loader.php
r38270 r38560 251 251 $scripts->add( 'imagesloaded', "/wp-includes/js/imagesloaded.min.js", array(), '3.2.0', 1 ); 252 252 $scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array( 'imagesloaded' ), '3.3.2', 1 ); 253 $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2 a', 1 );253 $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2b', 1 ); 254 254 255 255 $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1 ); … … 564 564 ) ); 565 565 566 $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery' ), false, 1 );566 $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery', 'underscore' ), false, 1 ); 567 567 568 568 $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 ); -
tags/4.6.1/src/wp-includes/taxonomy.php
r38270 r38560 4275 4275 if ( false === $object_terms ) { 4276 4276 $object_terms = wp_get_object_terms( $object_id, $taxonomy, array( 'update_term_meta_cache' => false ) ); 4277 if ( is_wp_error( $object_terms ) ) { 4278 return $object_terms; 4279 } 4280 4277 4281 wp_cache_set( $object_id, wp_list_pluck( $object_terms, 'term_id' ), "{$taxonomy}_relationships" ); 4278 4282 } -
tags/4.6.1/src/wp-includes/version.php
r38270 r38560 5 5 * @global string $wp_version 6 6 */ 7 $wp_version = '4.6 -src';7 $wp_version = '4.6.1-src'; 8 8 9 9 /** -
tags/4.6.1/src/wp-includes/wp-db.php
r38270 r38560 735 735 */ 736 736 public function init_charset() { 737 $charset = ''; 738 $collate = ''; 739 737 740 if ( function_exists('is_multisite') && is_multisite() ) { 738 741 $charset = 'utf8'; … … 809 812 $collate = $this->collate; 810 813 if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { 814 $set_charset_succeeded = true; 815 811 816 if ( $this->use_mysqli ) { 812 817 if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 813 mysqli_set_charset( $dbh, $charset );818 $set_charset_succeeded = mysqli_set_charset( $dbh, $charset ); 814 819 } 815 $query = $this->prepare( 'SET NAMES %s', $charset ); 816 if ( ! empty( $collate ) ) 817 $query .= $this->prepare( ' COLLATE %s', $collate ); 818 mysqli_query( $dbh, $query ); 820 821 if ( $set_charset_succeeded ) { 822 $query = $this->prepare( 'SET NAMES %s', $charset ); 823 if ( ! empty( $collate ) ) 824 $query .= $this->prepare( ' COLLATE %s', $collate ); 825 mysqli_query( $dbh, $query ); 826 } 819 827 } else { 820 828 if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 821 mysql_set_charset( $charset, $dbh );829 $set_charset_succeeded = mysql_set_charset( $charset, $dbh ); 822 830 } 823 $query = $this->prepare( 'SET NAMES %s', $charset ); 824 if ( ! empty( $collate ) ) 825 $query .= $this->prepare( ' COLLATE %s', $collate ); 826 mysql_query( $query, $dbh ); 831 if ( $set_charset_succeeded ) { 832 $query = $this->prepare( 'SET NAMES %s', $charset ); 833 if ( ! empty( $collate ) ) 834 $query .= $this->prepare( ' COLLATE %s', $collate ); 835 mysql_query( $query, $dbh ); 836 } 827 837 } 828 838 } -
tags/4.6.1/tests/phpunit/tests/general/resourceHints.php
r38270 r38560 32 32 33 33 function test_should_have_defaults_on_frontend() { 34 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";34 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 35 35 36 36 $this->expectOutputString( $expected ); … … 40 40 41 41 function test_dns_prefetching() { 42 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .43 "<link rel='dns-prefetch' href='//wordpress.org' >\n" .44 "<link rel='dns-prefetch' href='//google.com' >\n" .45 "<link rel='dns-prefetch' href='//make.wordpress.org' >\n";42 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 43 "<link rel='dns-prefetch' href='//wordpress.org' />\n" . 44 "<link rel='dns-prefetch' href='//google.com' />\n" . 45 "<link rel='dns-prefetch' href='//make.wordpress.org' />\n"; 46 46 47 47 add_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_domains' ), 10, 2 ); … … 71 71 */ 72 72 function test_preconnect() { 73 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .74 "<link rel='preconnect' href='//wordpress.org' >\n" .75 "<link rel='preconnect' href='https://make.wordpress.org' >\n" .76 "<link rel='preconnect' href='http://google.com' >\n" .77 "<link rel='preconnect' href='http://w.org' >\n";73 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 74 "<link rel='preconnect' href='//wordpress.org' />\n" . 75 "<link rel='preconnect' href='https://make.wordpress.org' />\n" . 76 "<link rel='preconnect' href='http://google.com' />\n" . 77 "<link rel='preconnect' href='http://w.org' />\n"; 78 78 79 79 add_filter( 'wp_resource_hints', array( $this, '_add_preconnect_domains' ), 10, 2 ); … … 99 99 100 100 function test_prerender() { 101 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .102 "<link rel='prerender' href='https://make.wordpress.org/great-again' >\n" .103 "<link rel='prerender' href='http://jobs.wordpress.net' >\n" .104 "<link rel='prerender' href='//core.trac.wordpress.org' >\n";101 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 102 "<link rel='prerender' href='https://make.wordpress.org/great-again' />\n" . 103 "<link rel='prerender' href='http://jobs.wordpress.net' />\n" . 104 "<link rel='prerender' href='//core.trac.wordpress.org' />\n"; 105 105 106 106 add_filter( 'wp_resource_hints', array( $this, '_add_prerender_urls' ), 10, 2 ); … … 125 125 126 126 function test_parse_url_dns_prefetch() { 127 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n" .128 "<link rel='dns-prefetch' href='//make.wordpress.org' >\n";127 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n" . 128 "<link rel='dns-prefetch' href='//make.wordpress.org' />\n"; 129 129 130 130 add_filter( 'wp_resource_hints', array( $this, '_add_dns_prefetch_long_urls' ), 10, 2 ); … … 146 146 147 147 function test_dns_prefetch_styles() { 148 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' >\n" .149 "<link rel='dns-prefetch' href='//s.w.org' >\n";148 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' />\n" . 149 "<link rel='dns-prefetch' href='//s.w.org' />\n"; 150 150 151 151 $args = array( … … 165 165 166 166 function test_dns_prefetch_scripts() { 167 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' >\n" .168 "<link rel='dns-prefetch' href='//s.w.org' >\n";167 $expected = "<link rel='dns-prefetch' href='//fonts.googleapis.com' />\n" . 168 "<link rel='dns-prefetch' href='//s.w.org' />\n"; 169 169 170 170 $args = array( … … 183 183 184 184 function test_dns_prefetch_scripts_does_not_included_registered_only() { 185 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";186 $unexpected = "<link rel='dns-prefetch' href='//wordpress.org' >\n";185 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 186 $unexpected = "<link rel='dns-prefetch' href='//wordpress.org' />\n"; 187 187 188 188 wp_register_script( 'jquery-elsewhere', 'https://wordpress.org/wp-includes/js/jquery/jquery.js' ); … … 200 200 */ 201 201 function test_deregistered_scripts_are_ignored() { 202 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";202 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 203 203 204 204 wp_enqueue_script( 'test-script', 'http://example.org/script.js' ); … … 213 213 */ 214 214 function test_malformed_urls() { 215 $expected = "<link rel='dns-prefetch' href='//s.w.org' >\n";215 $expected = "<link rel='dns-prefetch' href='//s.w.org' />\n"; 216 216 217 217 // Errant colon. -
tags/4.6.1/tests/phpunit/tests/http/base.php
r38270 r38560 377 377 } 378 378 379 /** 380 * @ticket 37733 381 */ 382 function test_url_with_double_slashes_path() { 383 $url = $this->redirection_script . '?rt=' . 0; 384 385 $path = parse_url( $url, PHP_URL_PATH ); 386 $url = str_replace( $path, '/' . $path, $url ); 387 388 $res = wp_remote_request( $url ); 389 $this->assertNotWPError( $res ); 390 } 391 379 392 380 393 } -
tags/4.6.1/tests/phpunit/tests/http/http.php
r38270 r38560 119 119 120 120 } 121 122 /** 123 * @ticket 37768 124 */ 125 public function test_normalize_cookies_scalar_values() { 126 $http = _wp_http_get_object(); 127 128 $cookies = array( 129 'x' => 'foo', 130 'y' => 2, 131 'z' => 0.45, 132 'foo' => array( 'bar' ), 133 ); 134 135 $cookie_jar = $http->normalize_cookies( array( 136 'x' => 'foo', 137 'y' => 2, 138 'z' => 0.45, 139 'foo' => array( 'bar' ), 140 ) ); 141 142 $this->assertInstanceOf( 'Requests_Cookie_Jar', $cookie_jar ); 143 144 foreach( array_keys( $cookies ) as $cookie ) { 145 if ( 'foo' === $cookie ) { 146 $this->assertFalse( isset( $cookie_jar[ $cookie ] ) ); 147 } else { 148 $this->assertInstanceOf( 'Requests_Cookie', $cookie_jar[ $cookie ] ); 149 } 150 } 151 } 121 152 } -
tags/4.6.1/tests/phpunit/tests/mail.php
r38270 r38560 343 343 } 344 344 } 345 346 /** 347 * Test that the Sender field in the SMTP envelope is not set by Core. 348 * 349 * Correctly setting the Sender requires knowledge that is not available 350 * to Core. An incorrect value will often lead to messages being rejected 351 * by the receiving MTA, so it's the admin's responsibility to 352 * set it correctly. 353 * 354 * @ticket 37736 355 */ 356 public function test_wp_mail_sender_not_set() { 357 wp_mail( 'user@example.org', 'Testing the Sender field', 'The Sender field should not have been set.' ); 358 359 $mailer = tests_retrieve_phpmailer_instance(); 360 361 $this->assertEquals( '', $mailer->Sender ); 362 } 345 363 } -
tags/4.6.1/tests/phpunit/tests/post/thumbnails.php
r38270 r38560 243 243 $GLOBALS['post'] = self::$post; 244 244 $_REQUEST['_thumbnail_id'] = self::$attachment_id; 245 $_REQUEST['preview_id'] = self::$post->ID; 245 246 246 247 $result = _wp_preview_post_thumbnail_filter( '', self::$post->ID, '_thumbnail_id' ); 248 249 // Clean up. 250 $GLOBALS['post'] = $old_post; 251 unset( $_REQUEST['_thumbnail_id'] ); 252 unset( $_REQUEST['preview_id'] ); 253 247 254 $this->assertEquals( self::$attachment_id, $result ); 248 255 } 256 257 /** 258 * @ticket 37697 259 */ 260 function test__wp_preview_post_thumbnail_filter_secondary_post() { 261 $old_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null; 262 263 $secondary_post = self::factory()->post->create( array( 264 'post_stauts' => 'publish', 265 ) 266 ); 267 268 $GLOBALS['post'] = self::$post; 269 $_REQUEST['_thumbnail_id'] = self::$attachment_id; 270 $_REQUEST['preview_id'] = $secondary_post; 271 272 $result = _wp_preview_post_thumbnail_filter( '', self::$post->ID, '_thumbnail_id' ); 273 274 // Clean up. 275 $GLOBALS['post'] = $old_post; 249 276 unset( $_REQUEST['_thumbnail_id'] ); 250 if ( null === $old_post ) { 251 unset( $GLOBALS['post'] ); 252 } else { 253 $GLOBALS['post'] = $old_post; 254 } 277 unset( $_REQUEST['preview_id'] ); 278 279 $this->assertEmpty( $result ); 255 280 } 256 281 -
tags/4.6.1/tests/phpunit/tests/term/isObjectInTerm.php
r38270 r38560 147 147 $this->assertSame( $num_queries, $wpdb->num_queries ); 148 148 } 149 150 /** 151 * @ticket 37721 152 */ 153 public function test_invalid_taxonomy_should_return_wp_error_object() { 154 $this->assertWPError( is_object_in_term( 12345, 'foo', 'bar' ) ); 155 } 149 156 }
Note: See TracChangeset
for help on using the changeset viewer.