Changes from tags/4.0 at r58128 to tags/4.0.1 at r58128
- Location:
- tags/4.0.1
- Files:
-
- 2 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/4.0.1/package.json
r58128 r58128 1 1 { 2 2 "name": "WordPress", 3 "version": "4.0. 0",3 "version": "4.0.1", 4 4 "description": "WordPress is web software you can use to create a beautiful website or blog.", 5 5 "repository": { -
tags/4.0.1/src/readme.html
r58128 r58128 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.0 12 <br /> Version 4.0.1 13 13 </h1> 14 14 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
tags/4.0.1/src/wp-admin/about.php
r58128 r58128 41 41 </a> 42 42 </h2> 43 44 <div class="changelog point-releases"> 45 <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 1 ); ?></h3> 46 <p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.', 47 '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 23 ), '4.0.1', number_format_i18n( 23 ) ); ?> 48 <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.0.1' ); ?> 49 </p> 50 </div> 43 51 44 52 <div class="changelog"> -
tags/4.0.1/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r58128 r58128 274 274 } 275 275 276 if ( 'top' == $which ) { ?> 276 if ( 'top' == $which ) { 277 wp_referer_field(); 278 ?> 277 279 <div class="tablenav top"> 278 280 <div class="alignleft actions"> -
tags/4.0.1/src/wp-admin/includes/image.php
r58128 r58128 402 402 } 403 403 404 foreach ( $meta as &$value ) { 405 if ( is_string( $value ) ) { 406 $value = wp_kses_post( $value ); 407 } 408 } 409 404 410 /** 405 411 * Filter the array of meta data read from an image's exif data. -
tags/4.0.1/src/wp-admin/includes/plugin-install.php
r58128 r58128 236 236 global $wp_list_table; 237 237 238 if ( current_filter() == 'install_plugins_favorites' && empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) 239 return; 240 241 $wp_list_table->display(); 238 if ( current_filter() == 'install_plugins_favorites' && empty( $_GET['user'] ) && ! get_user_option( 'wporg_favorites' ) ) { 239 return; 240 } 241 242 ?> 243 <form id="plugin-filter" action="" method="post"> 244 <?php $wp_list_table->display(); ?> 245 </form> 246 <?php 242 247 } 243 248 add_action( 'install_plugins_search', 'display_plugins_table' ); -
tags/4.0.1/src/wp-admin/includes/post.php
r58128 r58128 1206 1206 } 1207 1207 } else { 1208 if ( function_exists( 'mb_strlen' ) && mb_strlen( $post_name ) > 30 ) { 1209 $post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 ); 1210 } elseif ( strlen( $post_name ) > 30 ) { 1211 $post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 ); 1208 if ( function_exists( 'mb_strlen' ) ) { 1209 if ( mb_strlen( $post_name ) > 30 ) { 1210 $post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 ); 1211 } else { 1212 $post_name_abridged = $post_name; 1213 } 1212 1214 } else { 1213 $post_name_abridged = $post_name; 1215 if ( strlen( $post_name ) > 30 ) { 1216 $post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 ); 1217 } else { 1218 $post_name_abridged = $post_name; 1219 } 1214 1220 } 1215 1221 -
tags/4.0.1/src/wp-admin/js/editor-expand.js
r58128 r58128 3 3 window.wp = window.wp || {}; 4 4 5 jQuery( document ).ready( function( $) {5 jQuery( document ).ready( function( $ ) { 6 6 var $window = $( window ), 7 7 $document = $( document ), … … 149 149 // We need to wait for TinyMCE to initialize. 150 150 $document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) { 151 var hideFloatPanels = _.debounce( function() { 152 ! $( '.mce-floatpanel:hover' ).length && tinymce.ui.FloatPanel.hideAll(); 153 $( '.mce-tooltip' ).hide(); 154 }, 1000, true ); 155 151 156 // Make sure it's the main editor. 152 157 if ( editor.id !== 'content' ) { … … 225 230 // Adjust when switching editor modes. 226 231 function mceShow() { 232 $window.on( 'scroll.mce-float-panels', hideFloatPanels ); 233 227 234 setTimeout( function() { 228 235 editor.execCommand( 'wpAutoResize' ); … … 232 239 233 240 function mceHide() { 241 $window.off( 'scroll.mce-float-panels' ); 242 234 243 setTimeout( function() { 235 244 var top = $contentWrap.offset().top; … … 252 261 // Adjust when the editor resizes. 253 262 editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust ); 263 264 $window.off( 'scroll.mce-float-panels' ).on( 'scroll.mce-float-panels', hideFloatPanels ); 254 265 }; 255 266 … … 259 270 editor.off( 'hide', mceHide ); 260 271 editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust ); 272 273 $window.off( 'scroll.mce-float-panels' ); 261 274 }; 262 275 … … 591 604 592 605 adjust(); 606 }).on( 'wp-window-resized.editor-expand', function() { 607 if ( mceEditor && ! mceEditor.isHidden() ) { 608 mceEditor.execCommand( 'wpAutoResize' ); 609 } else { 610 textEditorResize(); 611 } 593 612 }); 594 613 -
tags/4.0.1/src/wp-admin/js/media.js
r58128 r58128 73 73 74 74 $( document ).ready( function() { 75 var $mediaGridWrap = $( '#wp-media-grid' ); 76 75 77 // Open up a manage media frame into the grid. 76 wp.media && wp.media({ 77 frame: 'manage', 78 container: $('#wpbody-content > .wrap') 79 }).open(); 78 if ( $mediaGridWrap.length && window.wp && window.wp.media ) { 79 window.wp.media({ 80 frame: 'manage', 81 container: $mediaGridWrap 82 }).open(); 83 } 80 84 81 85 $( '#find-posts-submit' ).click( function( event ) { -
tags/4.0.1/src/wp-admin/plugin-install.php
r58128 r58128 25 25 $wp_list_table = _get_list_table('WP_Plugin_Install_List_Table'); 26 26 $pagenum = $wp_list_table->get_pagenum(); 27 28 if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { 29 $location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) ); 30 31 if ( ! empty( $_REQUEST['paged'] ) ) { 32 $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); 33 } 34 35 wp_redirect( $location ); 36 exit; 37 } 38 27 39 $wp_list_table->prepare_items(); 40 41 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 42 43 if ( $pagenum > $total_pages && $total_pages > 0 ) { 44 wp_redirect( add_query_arg( 'paged', $total_pages ) ); 45 exit; 46 } 28 47 29 48 $title = __( 'Add Plugins' ); -
tags/4.0.1/src/wp-admin/press-this.php
r58128 r58128 64 64 if ( is_wp_error($upload) ) { 65 65 wp_delete_post($post_ID); 66 wp_die( $upload);66 wp_die( esc_html( $upload->get_error_message() ) ); 67 67 } else { 68 68 // Post formats. -
tags/4.0.1/src/wp-admin/upload.php
r58128 r58128 58 58 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 59 59 ?> 60 <div class="wrap" >60 <div class="wrap" id="wp-media-grid"> 61 61 <h2> 62 62 <?php -
tags/4.0.1/src/wp-includes/canonical.php
r58128 r58128 361 361 unset($redirect['port']); 362 362 363 if ( ! empty( $user_home['scheme'] ) && $user_home['scheme'] === 'https' ) {364 $redirect['scheme'] = 'https';365 }366 367 363 // trailing /index.php 368 364 $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']); … … 422 418 $redirect['host'] = $original['host']; 423 419 424 $compare_original = array( $original[' scheme'], $original['host'], $original['path'] );420 $compare_original = array( $original['host'], $original['path'] ); 425 421 426 422 if ( !empty( $original['port'] ) ) … … 430 426 $compare_original[] = $original['query']; 431 427 432 $compare_redirect = array( $redirect[' scheme'], $redirect['host'], $redirect['path'] );428 $compare_redirect = array( $redirect['host'], $redirect['path'] ); 433 429 434 430 if ( !empty( $redirect['port'] ) ) -
tags/4.0.1/src/wp-includes/class-phpass.php
r58128 r58128 215 215 function HashPassword($password) 216 216 { 217 if ( strlen( $password ) > 4096 ) { 218 return '*'; 219 } 220 217 221 $random = ''; 218 222 … … 250 254 function CheckPassword($password, $stored_hash) 251 255 { 256 if ( strlen( $password ) > 4096 ) { 257 return false; 258 } 259 252 260 $hash = $this->crypt_private($password, $stored_hash); 253 261 if ($hash[0] == '*') -
tags/4.0.1/src/wp-includes/css/media-views.css
r58128 r58128 6 6 -moz-box-sizing: content-box; 7 7 box-sizing: content-box; 8 } 9 10 .media-frame input, 11 .media-frame select, 12 .media-frame textarea { 13 -webkit-box-sizing: border-box; 14 -moz-box-sizing: border-box; 15 box-sizing: border-box; 8 16 } 9 17 … … 57 65 font-family: "Open Sans", sans-serif; 58 66 font-size: 12px; 59 -webkit-box-sizing: border-box;60 -moz-box-sizing: border-box;61 box-sizing: border-box;62 67 border-width: 1px; 63 68 border-style: solid; -
tags/4.0.1/src/wp-includes/formatting.php
r58128 r58128 29 29 */ 30 30 function wptexturize($text, $reset = false) { 31 global $wp_cockneyreplace ;31 global $wp_cockneyreplace, $shortcode_tags; 32 32 static $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements, 33 33 $default_no_texturize_tags, $default_no_texturize_shortcodes, $run_texturize = true; … … 206 206 // Look for shortcodes and HTML elements. 207 207 208 $tagnames = array_keys( $shortcode_tags ); 209 $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); 210 $tagregexp = "(?:$tagregexp)(?![\\w-])"; // Excerpt of get_shortcode_regex(). 211 212 $comment_regex = 213 '!' // Start of comment, after the <. 214 . '(?:' // Unroll the loop: Consume everything until --> is found. 215 . '-(?!->)' // Dash not followed by end of comment. 216 . '[^\-]*+' // Consume non-dashes. 217 . ')*+' // Loop possessively. 218 . '-->'; // End of comment. 219 208 220 $regex = '/(' // Capture the entire match. 209 221 . '<' // Find start of element. 210 222 . '(?(?=!--)' // Is this a comment? 211 . '.+?--\s*>'// Find end of comment223 . $comment_regex // Find end of comment 212 224 . '|' 213 225 . '[^>]+>' // Find end of element … … 215 227 . '|' 216 228 . '\[' // Find start of shortcode. 217 . '\[?' // Shortcodes may begin with [[ 229 . '[\/\[]?' // Shortcodes may begin with [/ or [[ 230 . $tagregexp // Only match registered shortcodes, because performance. 218 231 . '(?:' 219 . '[^\[\]<>] ' // Shortcodes do not contain other shortcodes.232 . '[^\[\]<>]+' // Shortcodes do not contain other shortcodes. Quantifier critical. 220 233 . '|' 221 . '<[^ >]+>' // HTML elements permitted. Prevents matching ] before >.222 . ') ++'234 . '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >. 235 . ')*+' // Possessive critical. 223 236 . '\]' // Find end of shortcode. 224 237 . '\]?' // Shortcodes may end with ]] … … 242 255 continue; 243 256 244 } elseif ( '[' === $first && 1 === preg_match( '/^\[ (?:[^\[\]<>]|<[^>]+>)++\]$/', $curl ) ) {257 } elseif ( '[' === $first && 1 === preg_match( '/^\[\/?' . $tagregexp . '(?:[^\[\]<>]+|<[^\[\]>]*>)*+\]$/', $curl ) ) { 245 258 // This is a shortcode delimiter. 246 259 247 260 _wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes ); 248 261 249 } elseif ( '[' === $first && 1 === preg_match( '/^\[ \[?(?:[^\[\]<>]|<[^>]+>)++\]\]?$/', $curl ) ) {262 } elseif ( '[' === $first && 1 === preg_match( '/^\[[\/\[]?' . $tagregexp . '(?:[^\[\]<>]+|<[^\[\]>]*>)*+\]\]?$/', $curl ) ) { 250 263 // This is an escaped shortcode delimiter. 251 264 -
tags/4.0.1/src/wp-includes/http.php
r58128 r58128 445 445 */ 446 446 function wp_http_validate_url( $url ) { 447 $original_url = $url; 447 448 $url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) ); 448 if ( ! $url )449 if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) ) 449 450 return false; 450 451 … … 456 457 return false; 457 458 458 if ( false !== strp os( $parsed_url['host'], ':' ) )459 if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) ) 459 460 return false; 460 461 … … 474 475 if ( $ip ) { 475 476 $parts = array_map( 'intval', explode( '.', $ip ) ); 476 if ( '127.0.0.1' === $ip 477 || ( 10 === $parts[0] ) 477 if ( 127 === $parts[0] || 10 === $parts[0] 478 478 || ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] ) 479 479 || ( 192 === $parts[0] && 168 === $parts[1] ) -
tags/4.0.1/src/wp-includes/js/media-grid.js
r58128 r58128 578 578 }, 579 579 /** 580 * Respond to the keyboard events: right arrow, left arrow, escape. 580 * Respond to the keyboard events: right arrow, left arrow, except when 581 * focus is in a textarea or input field. 581 582 */ 582 583 keyEvent: function( event ) { 583 if ( 'INPUT' === event.target.tagName&& ! ( event.target.readOnly || event.target.disabled ) ) {584 if ( ( 'INPUT' === event.target.nodeName || 'TEXTAREA' === event.target.nodeName ) && ! ( event.target.readOnly || event.target.disabled ) ) { 584 585 return; 585 586 } -
tags/4.0.1/src/wp-includes/js/media-views.js
r58128 r58128 5851 5851 priority: -60, 5852 5852 click: function() { 5853 var model, changed = [], self = this,5853 var changed = [], removed = [], self = this, 5854 5854 selection = this.controller.state().get( 'selection' ), 5855 5855 library = this.controller.state().get( 'library' ); … … 5870 5870 } 5871 5871 5872 while ( selection.length > 0 ) { 5873 model = selection.at( 0 ); 5872 selection.each( function( model ) { 5873 if ( ! model.get( 'nonces' )['delete'] ) { 5874 removed.push( model ); 5875 return; 5876 } 5877 5874 5878 if ( media.view.settings.mediaTrash && 'trash' === model.get( 'status' ) ) { 5875 5879 model.set( 'status', 'inherit' ); 5876 5880 changed.push( model.save() ); 5877 selection.remove( model );5881 removed.push( model ); 5878 5882 } else if ( media.view.settings.mediaTrash ) { 5879 5883 model.set( 'status', 'trash' ); 5880 5884 changed.push( model.save() ); 5881 selection.remove( model );5885 removed.push( model ); 5882 5886 } else { 5883 5887 model.destroy(); 5884 5888 } 5885 } 5889 } ); 5886 5890 5887 5891 if ( changed.length ) { 5892 selection.remove( removed ); 5893 5888 5894 $.when.apply( null, changed ).then( function() { 5889 5895 library._requery( true ); -
tags/4.0.1/src/wp-includes/js/mediaelement/mediaelement-and-player.min.js
r58128 r58128 11 11 * License: MIT 12 12 * 13 */var mejs=mejs||{};mejs.version="2.15. 0";mejs.meIndex=0;13 */var mejs=mejs||{};mejs.version="2.15.1";mejs.meIndex=0; 14 14 mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube","application/x-mpegURL"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],vimeo:[{version:null, 15 15 types:["video/vimeo","video/x-vimeo"]}]}; … … 102 102 c.updateCurrent();if(!c.isFullScreen){c.setPlayerSize(c.width,c.height);c.setControlsSize()}},false);setTimeout(function(){c.setPlayerSize(c.width,c.height);c.setControlsSize()},50);c.globalBind("resize",function(){c.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height);c.setControlsSize()});c.media.pluginType=="youtube"&&c.options.autoplay&&c.container.find(".mejs-overlay-play").hide()}d&&a.pluginType=="native"&&c.play();if(c.options.success)typeof c.options.success== 103 103 "string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},setPlayerSize:function(a,b){if(!this.options.setDimensions)return false;if(typeof a!="undefined")this.width=a;if(typeof b!="undefined")this.height=b;if(this.height.toString().indexOf("%")>0||this.$node.css("max-width")==="100%"||this.$node[0].currentStyle&&this.$node[0].currentStyle.maxWidth==="100%"){var c=this.isVideo? 104 this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.media.getAttribute("width")!==null?this.media.getAttribute("width"):this.options.defaultVideoWidth:this.options.defaultAudioHeight,e=this.isVideo?this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.media.getAttribute("height")!==null?this.media.getAttribute("height"):this.options.defaultVideoHeight:this.options.defaultAudioHeight,d=this.container.parent().closest(":visible").width();c=this.isVideo|| 105 !this.options.autosizeProgress?parseInt(d*e/c,10)>this.container.parent().closest(":visible").height()?this.container.parent().closest(":visible").height():parseInt(d*e/c,10):e;if(isNaN(c))c=this.container.parent().closest(":visible").height();if(this.container.parent()[0].tagName.toLowerCase()==="body"){d=f(window).width();c=f(window).height()}if(c!=0&&d!=0){this.container.width(d).height(c);this.$media.add(this.container.find(".mejs-shim")).width("100%").height("100%");this.isVideo&&this.media.setVideoSize&& 106 this.media.setVideoSize(d,c);this.layers.children(".mejs-layer").width("100%").height("100%")}}else{this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)}d=this.layers.find(".mejs-overlay-play");c=d.find(".mejs-overlay-button");d.height(this.container.height()-this.controls.height());c.css("margin-top","-"+(c.height()/2-this.controls.height()/2).toString()+"px")},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"), 107 e=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");var d=c.siblings(),g=d.last(),k=null;if(!(!this.container.is(":visible")||!c.length||!c.is(":visible"))){if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){d.each(function(){var j=f(this);if(j.css("position")!="absolute"&&j.is(":visible"))a+=f(this).outerWidth(true)});b=this.controls.width()-a-(c.outerWidth(true)-c.width())}do{c.width(b);e.width(b- 108 (e.outerWidth(true)-e.width()));if(g.css("position")!="absolute"){k=g.position();b--}}while(k!=null&&k.top>0&&b>0);this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()}},buildposter:function(a,b,c,e){var d=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):d.hide();e.addEventListener("play",function(){d.hide()},false);a.options.showPosterWhenEnded&&a.options.autoRewind&& 109 e.addEventListener("ended",function(){d.show()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"),c=b.find("img");if(c.length==0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a);b.css({"background-image":"url("+a+")"})},buildoverlays:function(a,b,c,e){var d=this;if(a.isVideo){var g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),k=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c), 110 j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).bind("click",function(){d.options.clickToPlayPause&&e.paused&&e.play()});e.addEventListener("play",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();k.hide()},false);e.addEventListener("playing",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();k.hide()},false);e.addEventListener("seeking",function(){g.show();b.find(".mejs-time-buffering").show()}, 111 false);e.addEventListener("seeked",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||j.show()},false);e.addEventListener("waiting",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("loadeddata",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("canplay",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);e.addEventListener("error",function(){g.hide(); 112 b.find(".mejs-time-buffering").hide();k.show();k.find("mejs-overlay-error").html("Error loading this resource")},false);e.addEventListener("keydown",function(m){d.onkeydown(a,e,m)},false)}},buildkeyboard:function(a,b,c,e){var d=this;d.globalBind("keydown",function(g){return d.onkeydown(a,e,g)});d.globalBind("click",function(g){a.hasFocus=f(g.target).closest(".mejs-container").length!=0})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var e=0,d=a.options.keyActions.length;e< 113 d;e++)for(var g=a.options.keyActions[e],k=0,j=g.keys.length;k<j;k++)if(c.keyCode==g.keys[k]){typeof c.preventDefault=="function"&&c.preventDefault();g.action(a,b,c.keyCode);return false}return true},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(c,e){e=f(e);a.tracks.push({srclang:e.attr("srclang")?e.attr("srclang").toLowerCase():"",src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className= 114 "mejs-container "+a;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.load();this.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.isLoaded||this.media.load();this.isLoaded=true},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume}, 115 setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b;for(a in this.options.features){b=this.options.features[a];if(this["clean"+b])try{this["clean"+b](this)}catch(c){}}if(this.isDynamic)this.$node.insertBefore(this.container);else{this.$media.prop("controls",true);this.$node.clone().insertBefore(this.container).show();this.$node.remove()}this.media.pluginType!=="native"&&this.media.remove();delete mejs.players[this.id];typeof this.container=="object"&&this.container.remove();this.globalUnbind(); 116 delete this.node.player}};(function(){function a(c,e){var d={d:[],w:[]};f.each((c||"").split(" "),function(g,k){var j=k+"."+e;if(j.indexOf(".")===0){d.d.push(j);d.w.push(j)}else d[b.test(k)?"w":"d"].push(j)});d.d=d.d.join(" ");d.w=d.w.join(" ");return d}var b=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,e,d){c=a(c,this.id);c.d&&f(document).bind(c.d,e,d);c.w&&f(window).bind(c.w, 117 e,d)};mejs.MediaElementPlayer.prototype.globalUnbind=function(c,e){c=a(c,this.id);c.d&&f(document).unbind(c.d,e);c.w&&f(window).unbind(c.w,e)}})();if(typeof f!="undefined"){f.fn.mediaelementplayer=function(a){a===false?this.each(function(){var b=f(this).data("mediaelementplayer");b&&b.remove();f(this).removeData("mediaelementplayer")}):this.each(function(){f(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,a))});return this};f(document).ready(function(){f(".mejs-player").mediaelementplayer()})}window.MediaElementPlayer= 118 mejs.MediaElementPlayer})(mejs.$); 104 this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.media.getAttribute("width")!==null?this.media.getAttribute("width"):this.options.defaultVideoWidth:this.options.defaultAudioWidth,e=this.isVideo?this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.media.getAttribute("height")!==null?this.media.getAttribute("height"):this.options.defaultVideoHeight:this.options.defaultAudioHeight,d=this.container.parent().closest(":visible").width(),g=this.container.parent().closest(":visible").height(); 105 c=this.isVideo||!this.options.autosizeProgress?parseInt(d*e/c,10):e;if(isNaN(c)||g!=0&&c>g)c=g;if(this.container.parent()[0].tagName.toLowerCase()==="body"){d=f(window).width();c=f(window).height()}if(c!=0&&d!=0){this.container.width(d).height(c);this.$media.add(this.container.find(".mejs-shim")).width("100%").height("100%");this.isVideo&&this.media.setVideoSize&&this.media.setVideoSize(d,c);this.layers.children(".mejs-layer").width("100%").height("100%")}}else{this.container.width(this.width).height(this.height); 106 this.layers.children(".mejs-layer").width(this.width).height(this.height)}d=this.layers.find(".mejs-overlay-play");g=d.find(".mejs-overlay-button");d.height(this.container.height()-this.controls.height());g.css("margin-top","-"+(g.height()/2-this.controls.height()/2).toString()+"px")},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),e=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");var d=c.siblings(), 107 g=d.last(),k=null;if(!(!this.container.is(":visible")||!c.length||!c.is(":visible"))){if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){d.each(function(){var j=f(this);if(j.css("position")!="absolute"&&j.is(":visible"))a+=f(this).outerWidth(true)});b=this.controls.width()-a-(c.outerWidth(true)-c.width())}do{c.width(b);e.width(b-(e.outerWidth(true)-e.width()));if(g.css("position")!="absolute"){k=g.position();b--}}while(k!=null&&k.top>0&&b>0);this.setProgressRail&& 108 this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()}},buildposter:function(a,b,c,e){var d=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):d.hide();e.addEventListener("play",function(){d.hide()},false);a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){d.show()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"), 109 c=b.find("img");if(c.length==0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a);b.css({"background-image":"url("+a+")"})},buildoverlays:function(a,b,c,e){var d=this;if(a.isVideo){var g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),k=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).bind("click", 110 function(){d.options.clickToPlayPause&&e.paused&&e.play()});e.addEventListener("play",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();k.hide()},false);e.addEventListener("playing",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();k.hide()},false);e.addEventListener("seeking",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("seeked",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone|| 111 j.show()},false);e.addEventListener("waiting",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("loadeddata",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("canplay",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);e.addEventListener("error",function(){g.hide();b.find(".mejs-time-buffering").hide();k.show();k.find("mejs-overlay-error").html("Error loading this resource")},false);e.addEventListener("keydown", 112 function(m){d.onkeydown(a,e,m)},false)}},buildkeyboard:function(a,b,c,e){var d=this;d.globalBind("keydown",function(g){return d.onkeydown(a,e,g)});d.globalBind("click",function(g){a.hasFocus=f(g.target).closest(".mejs-container").length!=0})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var e=0,d=a.options.keyActions.length;e<d;e++)for(var g=a.options.keyActions[e],k=0,j=g.keys.length;k<j;k++)if(c.keyCode==g.keys[k]){typeof c.preventDefault=="function"&&c.preventDefault(); 113 g.action(a,b,c.keyCode);return false}return true},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(c,e){e=f(e);a.tracks.push({srclang:e.attr("srclang")?e.attr("srclang").toLowerCase():"",src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.load();this.media.play()}, 114 pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.isLoaded||this.media.load();this.isLoaded=true},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b;for(a in this.options.features){b=this.options.features[a];if(this["clean"+ 115 b])try{this["clean"+b](this)}catch(c){}}if(this.isDynamic)this.$node.insertBefore(this.container);else{this.$media.prop("controls",true);this.$node.clone().insertBefore(this.container).show();this.$node.remove()}this.media.pluginType!=="native"&&this.media.remove();delete mejs.players[this.id];typeof this.container=="object"&&this.container.remove();this.globalUnbind();delete this.node.player}};(function(){function a(c,e){var d={d:[],w:[]};f.each((c||"").split(" "),function(g,k){var j=k+"."+e;if(j.indexOf(".")=== 116 0){d.d.push(j);d.w.push(j)}else d[b.test(k)?"w":"d"].push(j)});d.d=d.d.join(" ");d.w=d.w.join(" ");return d}var b=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,e,d){c=a(c,this.id);c.d&&f(document).bind(c.d,e,d);c.w&&f(window).bind(c.w,e,d)};mejs.MediaElementPlayer.prototype.globalUnbind=function(c,e){c=a(c,this.id);c.d&&f(document).unbind(c.d,e);c.w&&f(window).unbind(c.w,e)}})(); 117 if(typeof f!="undefined"){f.fn.mediaelementplayer=function(a){a===false?this.each(function(){var b=f(this).data("mediaelementplayer");b&&b.remove();f(this).removeData("mediaelementplayer")}):this.each(function(){f(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,a))});return this};f(document).ready(function(){f(".mejs-player").mediaelementplayer()})}window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$); 119 118 (function(f){f.extend(mejs.MepDefaults,{playpauseText:mejs.i18n.t("Play/Pause")});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,e){var d=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'" aria-label="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();e.paused?e.play():e.pause();return false});e.addEventListener("play",function(){d.removeClass("mejs-play").addClass("mejs-pause")}, 120 119 false);e.addEventListener("playing",function(){d.removeClass("mejs-play").addClass("mejs-pause")},false);e.addEventListener("pause",function(){d.removeClass("mejs-pause").addClass("mejs-play")},false);e.addEventListener("paused",function(){d.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$); … … 150 149 (mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();f(document.documentElement).removeClass("mejs-fullscreen");this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.media.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find(".mejs-shim").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight); 151 150 this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen=false;this.container.find(".mejs-captions-text").css("font-size","");this.container.find(".mejs-captions-position").css("bottom","")}}})})(mejs.$); 152 (function(f){f.extend(mejs.MepDefaults,{speeds:["1.50","1.25","1.00","0.75"],defaultSpeed:"1.00"});f.extend(MediaElementPlayer.prototype,{buildspeed:function(a,b,c,e){if( a.isVideo)if(this.media.pluginType=="native"){c='<div class="mejs-button mejs-speed-button"><button type="button">'+this.options.defaultSpeed+'x</button><div class="mejs-speed-selector"><ul>';var d;f.inArray(this.options.defaultSpeed,this.options.speeds)===-1&&this.options.speeds.push(this.options.defaultSpeed);this.options.speeds.sort(function(g,151 (function(f){f.extend(mejs.MepDefaults,{speeds:["1.50","1.25","1.00","0.75"],defaultSpeed:"1.00"});f.extend(MediaElementPlayer.prototype,{buildspeed:function(a,b,c,e){if(this.media.pluginType=="native"){c='<div class="mejs-button mejs-speed-button"><button type="button">'+this.options.defaultSpeed+'x</button><div class="mejs-speed-selector"><ul>';var d;f.inArray(this.options.defaultSpeed,this.options.speeds)===-1&&this.options.speeds.push(this.options.defaultSpeed);this.options.speeds.sort(function(g, 153 152 k){return parseFloat(k)-parseFloat(g)});for(d=0;d<this.options.speeds.length;d++){c+='<li><input type="radio" name="speed" value="'+this.options.speeds[d]+'" id="'+this.options.speeds[d]+'" ';if(this.options.speeds[d]==this.options.defaultSpeed){c+="checked=true ";c+='/><label for="'+this.options.speeds[d]+'" class="mejs-speed-selected">'+this.options.speeds[d]+"x</label></li>"}else c+='/><label for="'+this.options.speeds[d]+'">'+this.options.speeds[d]+"x</label></li>"}c+="</ul></div></div>";a.speedButton= 154 153 f(c).appendTo(b);a.playbackspeed=this.options.defaultSpeed;a.speedButton.on("click","input[type=radio]",function(){a.playbackspeed=f(this).attr("value");e.playbackRate=parseFloat(a.playbackspeed);a.speedButton.find("button").text(a.playbackspeed+"x");a.speedButton.find(".mejs-speed-selected").removeClass("mejs-speed-selected");a.speedButton.find("input[type=radio]:checked").next().addClass("mejs-speed-selected")});b=a.speedButton.find(".mejs-speed-selector");b.height(this.speedButton.find(".mejs-speed-selector ul").outerHeight(true)+ -
tags/4.0.1/src/wp-includes/js/quicktags.js
r58128 r58128 385 385 canvas.value = text.substring(0, startPos) + content + text.substring(endPos, text.length); 386 386 387 canvas.focus();388 387 canvas.selectionStart = startPos + content.length; 389 388 canvas.selectionEnd = startPos + content.length; 390 389 canvas.scrollTop = scrollTop; 390 canvas.focus(); 391 391 } else { 392 392 canvas.value += content; … … 510 510 } 511 511 512 canvas.focus();513 512 canvas.selectionStart = cursorPos; 514 513 canvas.selectionEnd = cursorPos; 515 514 canvas.scrollTop = scrollTop; 515 canvas.focus(); 516 516 } else { // other browsers? 517 517 if ( !endTag ) { -
tags/4.0.1/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r58128 r58128 1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wpeditimage', function( editor ) { 3 var toolbarActive = false, 3 var serializer, 4 toolbarActive = false, 4 5 editingImage = false; 5 6 … … 83 84 } 84 85 85 out = b.replace( / <dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>/gi, function( a, b, c, caption ) {86 out = b.replace( /\s*<dl ([^>]+)>\s*<dt [^>]+>([\s\S]+?)<\/dt>\s*<dd [^>]+>([\s\S]*?)<\/dd>\s*<\/dl>\s*/gi, function( a, b, c, caption ) { 86 87 var id, classes, align, width; 87 88 … … 117 118 }); 118 119 119 if ( out.indexOf('[caption') !== 0) {120 if ( out.indexOf('[caption') === -1 ) { 120 121 // the caption html seems broken, try to find the image that may be wrapped in a link 121 122 // and may be followed by <p> with the caption text. … … 227 228 } 228 229 230 // Verify HTML in captions 231 function verifyHTML( caption ) { 232 if ( ! caption || ( caption.indexOf( '<' ) === -1 && caption.indexOf( '>' ) === -1 ) ) { 233 return caption; 234 } 235 236 if ( ! serializer ) { 237 serializer = new tinymce.html.Serializer( {}, editor.schema ); 238 } 239 240 return serializer.serialize( editor.parser.parse( caption, { forced_root_block: false } ) ); 241 } 242 229 243 function updateImage( imageNode, imageData ) { 230 244 var classes, className, node, html, parent, wrap, linkNode, … … 304 318 305 319 if ( imageData.caption ) { 320 imageData.caption = verifyHTML( imageData.caption ); 306 321 307 322 id = imageData.attachment_id ? 'attachment_' + imageData.attachment_id : null; … … 646 661 // Convert remaining line breaks to <br> 647 662 caption = caption.replace( /(<br[^>]*>)\s*\n\s*/g, '$1' ).replace( /\s*\n\s*/g, '<br />' ); 663 caption = verifyHTML( caption ); 648 664 } 649 665 -
tags/4.0.1/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r58128 r58128 13 13 _noop = function() { return false; }, 14 14 isios = /iPad|iPod|iPhone/.test( navigator.userAgent ), 15 cursorInterval, lastKeyDownNode, setViewCursorTries, focus, execCommandView ;15 cursorInterval, lastKeyDownNode, setViewCursorTries, focus, execCommandView, execCommandBefore; 16 16 17 17 function getView( node ) { … … 369 369 function isSpecialKey( key ) { 370 370 return ( ( key <= 47 && key !== VK.SPACEBAR && key !== VK.ENTER && key !== VK.DELETE && key !== VK.BACKSPACE && ( key < 37 || key > 40 ) ) || 371 key >= 224 || // OEM or non-printable 371 key >= 224 || // OEM or non-printable 372 372 ( key >= 144 && key <= 150 ) || // Num Lock, Scroll Lock, OEM 373 373 ( key >= 91 && key <= 93 ) || // Windows keys … … 650 650 view; 651 651 652 if ( node && ( node.className === 'wpview-selection-before'|| node.className === 'wpview-selection-after' ) && ( view = getView( node ) ) ) {653 handleEnter( view );652 if ( node && ( ( execCommandBefore = node.className === 'wpview-selection-before' ) || node.className === 'wpview-selection-after' ) && ( view = getView( node ) ) ) { 653 handleEnter( view, execCommandBefore ); 654 654 execCommandView = view; 655 655 } … … 666 666 667 667 if ( execCommandView ) { 668 node = execCommandView .nextSibling;668 node = execCommandView[ execCommandBefore ? 'previousSibling' : 'nextSibling' ]; 669 669 670 670 if ( node && node.nodeName === 'P' && editor.dom.isEmpty( node ) ) { 671 671 editor.dom.remove( node ); 672 setViewCursor( false, execCommandView );672 setViewCursor( execCommandBefore, execCommandView ); 673 673 } 674 674 -
tags/4.0.1/src/wp-includes/kses.php
r58128 r58128 1441 1441 $css = str_replace(array("\n","\r","\t"), '', $css); 1442 1442 1443 if ( preg_match( '%[\\ (&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments1443 if ( preg_match( '%[\\\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments 1444 1444 return ''; 1445 1445 -
tags/4.0.1/src/wp-includes/link-template.php
r58128 r58128 258 258 $post_type = get_post_type_object($post->post_type); 259 259 260 if ( $post_type->hierarchical ) { 261 $slug = get_page_uri( $id ); 262 } 263 260 264 if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) { 261 265 if ( ! $leavename ) { 262 if ( $post_type->hierarchical )263 $slug = get_page_uri($id);264 266 $post_link = str_replace("%$post->post_type%", $slug, $post_link); 265 267 } … … 1512 1514 1513 1515 if ( ! empty( $excluded_terms ) ) { 1514 $where .= " AND p.ID NOT IN ( SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . implode( $excluded_terms, ',' ) . ') )';1516 $where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( $excluded_terms, ',' ) . ') )'; 1515 1517 } 1516 1518 } -
tags/4.0.1/src/wp-includes/media-template.php
r58128 r58128 313 313 314 314 <div class="attachment-actions"> 315 <# if ( 'image' === data.type && ! data.uploading && data.sizes ) { #>315 <# if ( 'image' === data.type && ! data.uploading && data.sizes && data.can.save ) { #> 316 316 <a class="button edit-attachment" href="#"><?php _e( 'Edit Image' ); ?></a> 317 317 <# } #> … … 395 395 <span class="value">{{ data.authorName }}</span> 396 396 </label> 397 <# if ( data.uploadedTo ) { #>397 <# if ( data.uploadedToTitle ) { #> 398 398 <label class="setting"> 399 399 <span class="name"><?php _e( 'Uploaded To' ); ?></span> … … 409 409 410 410 <div class="actions"> 411 <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> | 412 <a href="post.php?post={{ data.id }}&action=edit"><?php _e( 'Edit more details' ); ?></a> 411 <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> 412 <# if ( data.can.save ) { #> | 413 <a href="post.php?post={{ data.id }}&action=edit"><?php _e( 'Edit more details' ); ?></a> 414 <# } #> 413 415 <# if ( ! data.uploading && data.can.remove ) { #> | 414 416 <?php if ( MEDIA_TRASH ): ?> 415 417 <# if ( 'trash' === data.status ) { #> 416 418 <a class="untrash-attachment" href="#"><?php _e( 'Untrash' ); ?></a> … … 418 420 <a class="trash-attachment" href="#"><?php _e( 'Trash' ); ?></a> 419 421 <# } #> 420 421 422 423 422 <?php else: ?> 423 <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a> 424 <?php endif; ?> 425 <# } #> 424 426 </div> 425 427 -
tags/4.0.1/src/wp-includes/media.php
r58128 r58128 1248 1248 } 1249 1249 1250 if ( $atts['type'] !== 'audio' ) { 1251 $atts['type'] = 'video'; 1252 } 1253 1250 1254 $args = array( 1251 1255 'post_status' => 'inherit', … … 1597 1601 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ), 1598 1602 'id' => sprintf( 'audio-%d-%d', $post_id, $instances ), 1599 'loop' => $atts['loop'],1600 'autoplay' => $atts['autoplay'],1603 'loop' => wp_validate_boolean( $atts['loop'] ), 1604 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 1601 1605 'preload' => $atts['preload'], 1602 1606 'style' => 'width: 100%; visibility: hidden;', … … 1823 1827 'height' => absint( $atts['height'] ), 1824 1828 'poster' => esc_url( $atts['poster'] ), 1825 'loop' => $atts['loop'],1826 'autoplay' => $atts['autoplay'],1829 'loop' => wp_validate_boolean( $atts['loop'] ), 1830 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 1827 1831 'preload' => $atts['preload'], 1828 1832 ); … … 2644 2648 if ( $attachment->post_parent ) { 2645 2649 $post_parent = get_post( $attachment->post_parent ); 2650 } else { 2651 $post_parent = false; 2652 } 2653 2654 if ( $post_parent ) { 2646 2655 $parent_type = get_post_type_object( $post_parent->post_type ); 2647 2656 if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) { -
tags/4.0.1/src/wp-includes/ms-functions.php
r58128 r58128 1380 1380 populate_options(); 1381 1381 populate_roles(); 1382 $wp_roles->_init(); 1382 1383 // populate_roles() clears previous role definitions so we start over. 1384 $wp_roles = new WP_Roles(); 1383 1385 1384 1386 $url = untrailingslashit( $url ); -
tags/4.0.1/src/wp-includes/pluggable.php
r58128 r58128 670 670 671 671 $key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme ); 672 $hash = hash_hmac( 'sha256', $username . '|' . $expiration . '|' . $token, $key ); 672 673 // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. 674 $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; 675 $hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key ); 673 676 674 677 if ( ! hash_equals( $hash, $hmac ) ) { … … 735 738 736 739 $key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme ); 737 $hash = hash_hmac( 'sha256', $user->user_login . '|' . $expiration . '|' . $token, $key ); 740 741 // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. 742 $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; 743 $hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key ); 738 744 739 745 $cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash; … … 1934 1940 // If the hash is still md5... 1935 1941 if ( strlen($hash) <= 32 ) { 1936 $check = ( $hash == md5($password) );1942 $check = hash_equals( $hash, md5( $password ) ); 1937 1943 if ( $check && $user_id ) { 1938 1944 // Rehash using new hash. -
tags/4.0.1/src/wp-includes/post.php
r58128 r58128 4720 4720 $defaults = array( 4721 4721 'file' => $file, 4722 'post_parent' => $parent4722 'post_parent' => 0 4723 4723 ); 4724 4724 4725 $data = wp_parse_args( $args, $defaults ); 4726 4727 if ( ! empty( $parent ) ) { 4728 $data['post_parent'] = $parent; 4729 } 4725 4730 4726 4731 $data['post_type'] = 'attachment'; -
tags/4.0.1/src/wp-includes/session.php
r58128 r58128 62 62 */ 63 63 final private function hash_token( $token ) { 64 return hash( 'sha256', $token ); 64 // If ext/hash is not present, use sha1() instead. 65 if ( function_exists( 'hash' ) ) { 66 return hash( 'sha256', $token ); 67 } else { 68 return sha1( $token ); 69 } 65 70 } 66 71 -
tags/4.0.1/src/wp-includes/user.php
r58128 r58128 1819 1819 1820 1820 if ( $update ) { 1821 if ( $user_email !== $old_user_data->user_email ) { 1822 $data['user_activation_key'] = ''; 1823 } 1821 1824 $wpdb->update( $wpdb->users, $data, compact( 'ID' ) ); 1822 1825 $user_id = (int) $ID; -
tags/4.0.1/src/wp-includes/version.php
r58128 r58128 5 5 * @global string $wp_version 6 6 */ 7 $wp_version = '4.0 -src';7 $wp_version = '4.0.1-src'; 8 8 9 9 /** -
tags/4.0.1/src/wp-login.php
r58128 r58128 572 572 list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 ); 573 573 $user = check_password_reset_key( $rp_key, $rp_login ); 574 if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) { 575 $user = false; 576 } 574 577 } else { 575 578 $user = false; … … 641 644 do_action( 'resetpass_form', $user ); 642 645 ?> 646 <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" /> 643 647 <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Reset Password'); ?>" /></p> 644 648 </form> -
tags/4.0.1/tests/phpunit/tests/auth.php
r58128 r58128 3 3 /** 4 4 * @group pluggable 5 * @group auth 5 6 */ 6 7 class Tests_Auth extends WP_UnitTestCase { … … 100 101 $this->assertFalse( wp_verify_nonce( null ) ); 101 102 } 103 104 function test_password_length_limit() { 105 $passwords = array( 106 str_repeat( 'a', 4095 ), // short 107 str_repeat( 'a', 4096 ), // limit 108 str_repeat( 'a', 4097 ), // long 109 ); 110 111 $user_id = $this->factory->user->create( array( 'user_login' => 'password-length-test' ) ); 112 113 wp_set_password( $passwords[1], $user_id ); 114 $user = get_user_by( 'id', $user_id ); 115 // phpass hashed password 116 $this->assertStringStartsWith( '$P$', $user->data->user_pass ); 117 118 $user = wp_authenticate( 'password-length-test', $passwords[0] ); 119 // Wrong Password 120 $this->assertInstanceOf( 'WP_Error', $user ); 121 122 $user = wp_authenticate( 'password-length-test', $passwords[1] ); 123 $this->assertInstanceOf( 'WP_User', $user ); 124 $this->assertEquals( $user_id, $user->ID ); 125 126 $user = wp_authenticate( 'password-length-test', $passwords[2] ); 127 // Wrong Password 128 $this->assertInstanceOf( 'WP_Error', $user ); 129 130 131 wp_set_password( $passwords[2], $user_id ); 132 $user = get_user_by( 'id', $user_id ); 133 // Password broken by setting it to be too long. 134 $this->assertEquals( '*', $user->data->user_pass ); 135 136 $user = wp_authenticate( 'password-length-test', $passwords[0] ); 137 // Wrong Password 138 $this->assertInstanceOf( 'WP_Error', $user ); 139 140 $user = wp_authenticate( 'password-length-test', $passwords[1] ); 141 // Wrong Password 142 $this->assertInstanceOf( 'WP_Error', $user ); 143 144 $user = wp_authenticate( 'password-length-test', $passwords[2] ); 145 // Password broken by setting it to be too long. 146 $this->assertInstanceOf( 'WP_Error', $user ); 147 } 102 148 } -
tags/4.0.1/tests/phpunit/tests/formatting/WPTexturize.php
r58128 r58128 12 12 function test_disable() { 13 13 $this->assertEquals('<pre>---</pre>', wptexturize('<pre>---</pre>')); 14 $this->assertEquals('[a]a–b[code]---[/code]a–b[/a]', wptexturize('[a]a--b[code]---[/code]a--b[/a]'));15 14 $this->assertEquals('<pre><code></code>--</pre>', wptexturize('<pre><code></code>--</pre>')); 16 15 … … 1194 1193 ), 1195 1194 array( 1195 '[is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]', 1196 '[is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]', 1197 ), 1198 array( 1199 '[caption - is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]', 1200 '[caption – is it wise to <a title="allow user content ] here? hmm"> maybe </a> ]', 1201 ), 1202 array( 1203 '[caption - is it wise to <a title="allow user content here? hmm"> ] maybe </a> ]', 1204 '[caption - is it wise to <a title="allow user content here? hmm"> ] maybe </a> ]', 1205 ), 1206 array( 1207 '[caption - is it wise to <a title="allow user content here? hmm"> maybe </a> ]', 1208 '[caption - is it wise to <a title="allow user content here? hmm"> maybe </a> ]', 1209 ), 1210 array( 1211 '[caption compare=">"]', 1212 '[caption compare=”>”]', 1213 ), 1214 array( 1215 '[caption compare="<>"]', 1216 '[caption compare="<>"]', 1217 ), 1218 array( 1219 '[caption compare="<" attr2="value" <!-->/]', 1220 '[caption compare="<" attr2="value" <!-->/]', 1221 ), 1222 array( 1223 '[caption compare="<"]', 1224 '[caption compare=”<”]', 1225 ), 1226 array( 1227 '[caption compare="<"]<br />', 1228 '[caption compare=”<"]<br />', 1229 ), 1230 array( 1196 1231 '[ photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy </a> ]', 1197 1232 '[ photos by <a href="http://example.com/?a[]=1&a[]=2"> this guy </a> ]', … … 1211 1246 array( 1212 1247 '[/...]', // This would actually be ignored by the shortcode system. The decision to not texturize it is intentional, if not correct. 1213 '[/ ...]',1248 '[/…]', 1214 1249 ), 1215 1250 array( 1216 1251 '[...]...[/...]', // These are potentially usable shortcodes. 1217 '[ ...]…[/...]',1252 '[…]…[/…]', 1218 1253 ), 1219 1254 array( 1220 1255 '[[...]]...[[/...]]', // Shortcode parsing will ignore the inner ]...[ part and treat this as a single escaped shortcode. 1221 '[[ ...]]…[[/...]]',1256 '[[…]]…[[/…]]', 1222 1257 ), 1223 1258 array( 1224 1259 '[[[...]]]...[[[/...]]]', // Again, shortcode parsing matches, but only the [[...] and [/...]] parts. 1225 '[[[ ...]]]…[[[/...]]]',1260 '[[[…]]]…[[[/…]]]', 1226 1261 ), 1227 1262 array( … … 1231 1266 array( 1232 1267 '[code]...[/code]]...', // These are potentially usable shortcodes. Unfortunately, the meaning of [/code]] is ambiguous unless we run the entire shortcode regexp. 1233 '[code] ...[/code]]...', // This test would not pass in 3.9 because the extra brace was always ignored by texturize.1268 '[code]…[/code]]…', // This test would not pass in 3.9 because the extra brace was always ignored by texturize. 1234 1269 ), 1235 1270 array( … … 1346 1381 ), 1347 1382 array( 1348 '[Let\'s get crazy<input>[ plugin code="<a href=\'?a[]=100\'>hello</a>"]</input>world]',1349 '[Let’s get crazy<input>[ plugin code="<a href=\'?a[]=100\'>hello</a>"]</input>world]',1383 '[Let\'s get crazy<input>[caption code="<a href=\'?a[]=100\'>hello</a>"]</input>world]', // caption shortcode is invalid here because it contains [] chars. 1384 '[Let’s get crazy<input>[caption code=”<a href=\'?a[]=100\'>hello</a>“]</input>world]', 1350 1385 ), 1351 1386 ); … … 1716 1751 array( 1717 1752 '<span>hello[code]---</span>', 1718 '<span>hello[code] ---</span>',1753 '<span>hello[code]—</span>', 1719 1754 ), 1720 1755 array( 1721 1756 '[code]hello<span>---</span>', 1722 '[code]hello<span> ---</span>',1757 '[code]hello<span>—</span>', 1723 1758 ), 1724 1759 array( 1725 1760 '[code]hello</span>---</span>', 1726 '[code]hello</span>---</span>', 1761 '[code]hello</span>—</span>', 1762 ), 1763 ); 1764 } 1765 1766 /** 1767 * Test disabling shortcode texturization. 1768 * 1769 * @ticket 29557 1770 * @dataProvider data_unregistered_shortcodes 1771 */ 1772 function test_unregistered_shortcodes( $input, $output ) { 1773 add_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 ); 1774 1775 $output = $this->assertEquals( $output, wptexturize( $input ) ); 1776 1777 remove_filter( 'no_texturize_shortcodes', array( $this, 'filter_shortcodes' ), 10, 1 ); 1778 return $output; 1779 } 1780 1781 function filter_shortcodes( $disabled ) { 1782 $disabled[] = 'audio'; 1783 return $disabled; 1784 } 1785 1786 function data_unregistered_shortcodes() { 1787 return array( 1788 array( 1789 '[a]a--b[code]---[/code]a--b[/a]', // code is not a registered shortcode. 1790 '[a]a–b[code]—[/code]a–b[/a]', 1791 ), 1792 array( 1793 '[a]a--b[audio]---[/audio]a--b[/a]', 1794 '[a]a–b[audio]---[/audio]a–b[/a]', 1795 ), 1796 array( 1797 '[code ...]...[/code]', // code is not a registered shortcode. 1798 '[code …]…[/code]', 1799 ), 1800 array( 1801 '[hello ...]...[/hello]', // hello is not a registered shortcode. 1802 '[hello …]…[/hello]', 1803 ), 1804 array( 1805 '[...]...[/...]', // These are potentially usable shortcodes. 1806 '[…]…[/…]', 1807 ), 1808 array( 1809 '[gal>ery ...]', 1810 '[gal>ery …]', 1811 ), 1812 array( 1813 '[randomthing param="test"]', 1814 '[randomthing param=”test”]', 1815 ), 1816 array( 1817 '[[audio]...[/audio]...', // These are potentially usable shortcodes. Unfortunately, the meaning of [[audio] is ambiguous unless we run the entire shortcode regexp. 1818 '[[audio]…[/audio]…', 1819 ), 1820 array( 1821 '[audio]...[/audio]]...', // These are potentially usable shortcodes. Unfortunately, the meaning of [/audio]] is ambiguous unless we run the entire shortcode regexp. 1822 '[audio]...[/audio]]...', // This test would not pass in 3.9 because the extra brace was always ignored by texturize. 1823 ), 1824 array( 1825 '<span>hello[/audio]---</span>', 1826 '<span>hello[/audio]—</span>', 1827 ), 1828 array( 1829 '[/audio]hello<span>---</span>', 1830 '[/audio]hello<span>—</span>', 1831 ), 1832 array( 1833 '[audio]hello[/audio]---</span>', 1834 '[audio]hello[/audio]—</span>', 1835 ), 1836 array( 1837 '<span>hello</span>---[audio]', 1838 '<span>hello</span>—[audio]', 1839 ), 1840 array( 1841 '<span>hello[audio]---</span>', 1842 '<span>hello[audio]---</span>', 1843 ), 1844 array( 1845 '[audio]hello<span>---</span>', 1846 '[audio]hello<span>---</span>', 1847 ), 1848 array( 1849 '[audio]hello</span>---</span>', 1850 '[audio]hello</span>---</span>', 1727 1851 ), 1728 1852 ); -
tags/4.0.1/tests/phpunit/tests/link.php
r58128 r58128 191 191 192 192 /** 193 * @ticket 22112194 */193 * @ticket 22112 194 */ 195 195 function test_get_adjacent_post_exclude_self_term() { 196 $include = $this->factory->category->create(); 196 // Bump term_taxonomy to mimic shared term offsets. 197 global $wpdb; 198 $wpdb->insert( $wpdb->term_taxonomy, array( 'taxonomy' => 'foo', 'term_id' => 12345, 'description' => '' ) ); 199 200 $include = $this->factory->term->create( array( 201 'taxonomy' => 'category', 202 'name' => 'Include', 203 ) ); 197 204 $exclude = $this->factory->category->create(); 198 205 -
tags/4.0.1/tests/phpunit/tests/post/attachments.php
r58128 r58128 255 255 } 256 256 257 /** 258 * @ticket 29646 259 */ 260 function test_update_orphan_attachment_parent() { 261 $filename = ( DIR_TESTDATA . '/images/test-image.jpg' ); 262 $contents = file_get_contents( $filename ); 263 264 $upload = wp_upload_bits( basename( $filename ), null, $contents ); 265 $this->assertTrue( empty( $upload['error'] ) ); 266 267 $attachment_id = $this->_make_attachment( $upload ); 268 269 // Assert that the attachment is an orphan 270 $attachment = get_post( $attachment_id ); 271 $this->assertEquals( $attachment->post_parent, 0 ); 272 273 $post_id = wp_insert_post( array( 'post_content' => rand_str(), 'post_title' => rand_str() ) ); 274 275 // Assert that the attachment has a parent 276 wp_insert_attachment( $attachment, '', $post_id ); 277 $attachment = get_post( $attachment_id ); 278 $this->assertEquals( $attachment->post_parent, $post_id ); 279 } 280 257 281 } -
tags/4.0.1/tests/phpunit/tests/query/results.php
r58128 r58128 652 652 } 653 653 654 /** 655 * @ticket 29615 656 */ 657 function test_child_post_in_hierarchical_post_type_with_default_permalinks() { 658 global $wp_rewrite; 659 660 $old_permastruct = get_option( 'permalink_structure' ); 661 $wp_rewrite->set_permalink_structure( '' ); 662 $wp_rewrite->flush_rules(); 663 664 register_post_type( 'handbook', array( 'hierarchical' => true ) ); 665 666 $post_1 = $this->factory->post->create( array( 'post_title' => 'Contributing to the WordPress Codex', 'post_type' => 'handbook' ) ); 667 $post_2 = $this->factory->post->create( array( 'post_title' => 'Getting Started', 'post_parent' => $post_1, 'post_type' => 'handbook' ) ); 668 669 $this->assertContains( 'contributing-to-the-wordpress-codex/getting-started', get_permalink( $post_2 ) ); 670 671 $result = $this->q->query( array( 'handbook' => 'contributing-to-the-wordpress-codex/getting-started', 'post_type' => 'handbook' ) ); 672 $this->assertCount( 1, $result ); 673 674 $wp_rewrite->set_permalink_structure( $old_permastruct ); 675 $wp_rewrite->flush_rules(); 676 } 677 654 678 } -
tags/4.0.1/tests/phpunit/tests/user.php
r58128 r58128 655 655 $this->assertNotContains( 'key', $metas ); 656 656 } 657 658 function test_changing_email_invalidates_password_reset_key() { 659 global $wpdb; 660 661 $user = $this->factory->user->create_and_get(); 662 $wpdb->update( $wpdb->users, array( 'user_activation_key' => 'key' ), array( 'ID' => $user->ID ) ); 663 clean_user_cache( $user ); 664 665 $user = get_userdata( $user->ID ); 666 $this->assertEquals( 'key', $user->user_activation_key ); 667 668 // Check that changing something other than the email doesn't remove the key. 669 $userdata = array( 670 'ID' => $user->ID, 671 'user_nicename' => 'wat', 672 ); 673 wp_update_user( $userdata ); 674 675 $user = get_userdata( $user->ID ); 676 $this->assertEquals( 'key', $user->user_activation_key ); 677 678 // Now check that changing the email does remove it. 679 $userdata = array( 680 'ID' => $user->ID, 681 'user_nicename' => 'cat', 682 'user_email' => 'foo@bar.dev', 683 ); 684 wp_update_user( $userdata ); 685 686 $user = get_userdata( $user->ID ); 687 $this->assertEmpty( $user->user_activation_key ); 688 } 657 689 } -
tags/4.0.1/tests/phpunit/tests/xmlrpc/wp/uploadFile.php
r58128 r58128 56 56 } 57 57 58 /**59 * @ticket 1194660 */61 function test_valid_mime() {62 $this->make_user_by_role( 'editor' );63 64 // create attachment65 $filename = ( DIR_TESTDATA . '/images/test-image-mime-jpg.png' );66 $contents = file_get_contents( $filename );67 $data = array(68 'name' => 'test-image-mime-jpg.png',69 'type' => 'image/png',70 'bits' => $contents71 );72 73 $result = $this->myxmlrpcserver->mw_newMediaObject( array( 0, 'editor', 'editor', $data ) );74 75 $this->assertNotInstanceOf( 'IXR_Error', $result );76 77 $this->assertEquals( 'image/jpeg', $result['type'] );78 }79 58 }
Note: See TracChangeset
for help on using the changeset viewer.