Changes from tags/4.1 at r59229 to tags/4.1.1 at r59229
- Location:
- tags/4.1.1
- Files:
-
- 4 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/4.1.1/package.json
r59229 r59229 1 1 { 2 2 "name": "WordPress", 3 "version": "4.1. 0",3 "version": "4.1.1", 4 4 "description": "WordPress is web software you can use to create a beautiful website or blog.", 5 5 "repository": { -
tags/4.1.1/src/license.txt
r59229 r59229 1 1 WordPress - Web publishing software 2 2 3 Copyright 201 4by the contributors3 Copyright 2015 by the contributors 4 4 5 5 This program is free software; you can redistribute it and/or modify -
tags/4.1.1/src/readme.html
r59229 r59229 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.1 12 <br /> Version 4.1.1 13 13 </h1> 14 14 <p style="text-align: center">Semantic Personal Publishing Platform</p> -
tags/4.1.1/src/wp-admin/about.php
r59229 r59229 41 41 </a> 42 42 </h2> 43 44 <div class="changelog point-releases"> 45 <h3><?php echo _n( 'Maintenance Release', 'Maintenance Releases', 1 ); ?></h3> 46 <p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.', 47 '<strong>Version %1$s</strong> addressed %2$s bugs.', 21 ), '4.1.1', number_format_i18n( 21 ) ); ?> 48 <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_4.1.1' ); ?> 49 </p> 50 </div> 43 51 44 52 <div class="changelog headline-feature"> -
tags/4.1.1/src/wp-admin/async-upload.php
r59229 r59229 33 33 require_once( ABSPATH . 'wp-admin/admin.php' ); 34 34 35 header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); 36 35 37 if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { 36 38 include( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); … … 46 48 wp_die( __( 'You do not have permission to upload files.' ) ); 47 49 } 48 49 header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );50 50 51 51 // just fetch the detail form for that attachment -
tags/4.1.1/src/wp-admin/includes/ajax-actions.php
r59229 r59229 1833 1833 function wp_ajax_upload_attachment() { 1834 1834 check_ajax_referer( 'media-form' ); 1835 /* 1836 * This function does not use wp_send_json_success() / wp_send_json_error() 1837 * as the html4 Plupload handler requires a text/html content-type for older IE. 1838 * See https://core.trac.wordpress.org/ticket/31037 1839 */ 1835 1840 1836 1841 if ( ! current_user_can( 'upload_files' ) ) { 1837 wp_send_json_error( array( 1838 'message' => __( "You don't have permission to upload files." ), 1839 'filename' => $_FILES['async-upload']['name'], 1842 echo wp_json_encode( array( 1843 'success' => false, 1844 'data' => array( 1845 'message' => __( "You don't have permission to upload files." ), 1846 'filename' => $_FILES['async-upload']['name'], 1847 ) 1840 1848 ) ); 1849 1850 wp_die(); 1841 1851 } 1842 1852 … … 1844 1854 $post_id = $_REQUEST['post_id']; 1845 1855 if ( ! current_user_can( 'edit_post', $post_id ) ) { 1846 wp_send_json_error( array( 1847 'message' => __( "You don't have permission to attach files to this post." ), 1848 'filename' => $_FILES['async-upload']['name'], 1856 echo wp_json_encode( array( 1857 'success' => false, 1858 'data' => array( 1859 'message' => __( "You don't have permission to attach files to this post." ), 1860 'filename' => $_FILES['async-upload']['name'], 1861 ) 1849 1862 ) ); 1863 1864 wp_die(); 1850 1865 } 1851 1866 } else { … … 1859 1874 $wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'], false ); 1860 1875 if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) { 1861 wp_send_json_error( array( 1862 'message' => __( 'The uploaded file is not a valid image. Please try again.' ), 1876 echo wp_json_encode( array( 1877 'success' => false, 1878 'data' => array( 1879 'message' => __( 'The uploaded file is not a valid image. Please try again.' ), 1880 'filename' => $_FILES['async-upload']['name'], 1881 ) 1882 ) ); 1883 1884 wp_die(); 1885 } 1886 } 1887 1888 $attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data ); 1889 1890 if ( is_wp_error( $attachment_id ) ) { 1891 echo wp_json_encode( array( 1892 'success' => false, 1893 'data' => array( 1894 'message' => $attachment_id->get_error_message(), 1863 1895 'filename' => $_FILES['async-upload']['name'], 1864 ) ); 1865 } 1866 } 1867 1868 $attachment_id = media_handle_upload( 'async-upload', $post_id, $post_data ); 1869 1870 if ( is_wp_error( $attachment_id ) ) { 1871 wp_send_json_error( array( 1872 'message' => $attachment_id->get_error_message(), 1873 'filename' => $_FILES['async-upload']['name'], 1896 ) 1874 1897 ) ); 1898 1899 wp_die(); 1875 1900 } 1876 1901 … … 1886 1911 wp_die(); 1887 1912 1888 wp_send_json_success( $attachment ); 1913 echo wp_json_encode( array( 1914 'success' => true, 1915 'data' => $attachment, 1916 ) ); 1917 1918 wp_die(); 1889 1919 } 1890 1920 -
tags/4.1.1/src/wp-admin/includes/taxonomy.php
r59229 r59229 12 12 13 13 /** 14 * {@internal Missing Short Description}} 15 * 16 * @since 2.0.0 17 * 18 * @param int|string $cat_name 19 * @return int 20 */ 21 function category_exists($cat_name, $parent = 0) { 14 * Check whether a category exists. 15 * 16 * @since 2.0.0 17 * 18 * @see term_exists() 19 * 20 * @param int|string $cat_name Category name. 21 * @param int $parent Optional. ID of parent term. 22 * @return mixed 23 */ 24 function category_exists( $cat_name, $parent = null ) { 22 25 $id = term_exists($cat_name, 'category', $parent); 23 26 if ( is_array($id) ) -
tags/4.1.1/src/wp-admin/includes/update-core.php
r59229 r59229 695 695 'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js', 696 696 'wp-includes/js/jquery/ui/jquery.ui.widget.min.js', 697 'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png', 697 698 ); 698 699 -
tags/4.1.1/src/wp-admin/js/common.js
r59229 r59229 172 172 173 173 $(document).ready( function() { 174 var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions, 174 var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions, $firstHeading, 175 175 lastClicked = false, 176 176 pageInput = $('input.current-page'), … … 369 369 } 370 370 371 // Move .updated and .error alert boxes. Don't move boxes designed to be inline. 372 $('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2'); 373 $('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') ); 371 // Move .notice, .updated and .error alert boxes. Don't move boxes designed to be inline. 372 $firstHeading = $( 'div.wrap h2:first' ); 373 $firstHeading.nextAll( 'div.updated, div.error, div.notice' ).addClass( 'below-h2' ); 374 $( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading ); 374 375 375 376 // Init screen meta -
tags/4.1.1/src/wp-admin/js/customize-controls.js
r59229 r59229 129 129 var equal = ( 130 130 listA.length === listB.length && // if lists are different lengths, then naturally they are not equal 131 -1 === _. map( // are there any false values in the list returned by map?131 -1 === _.indexOf( _.map( // are there any false values in the list returned by map? 132 132 _.zip( listA, listB ), // pair up each element between the two lists 133 133 function ( pair ) { 134 134 return $( pair[0] ).is( pair[1] ); // compare to see if each pair are equal 135 135 } 136 ) .indexOf(false ) // check for presence of false in map's return value136 ), false ) // check for presence of false in map's return value 137 137 ); 138 138 return equal; -
tags/4.1.1/src/wp-admin/update-core.php
r59229 r59229 243 243 $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug )); 244 244 if ( is_wp_error( $info ) ) { 245 continue;245 $info = false; 246 246 } 247 247 -
tags/4.1.1/src/wp-admin/user-edit.php
r59229 r59229 490 490 <th> </th> 491 491 <td aria-live="assertive"> 492 <div class="destroy-sessions"><button disabled class="button button-secondary"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div>492 <div class="destroy-sessions"><button type="button" disabled class="button button-secondary"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div> 493 493 <p class="description"> 494 494 <?php _e( 'You are only logged in at this location.' ); ?> … … 500 500 <th> </th> 501 501 <td aria-live="assertive"> 502 <div class="destroy-sessions"><button class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div>502 <div class="destroy-sessions"><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div> 503 503 <p class="description"> 504 504 <?php _e( 'Left your account logged in at a public computer? Lost your phone? This will log you out everywhere except your current browser.' ); ?> … … 510 510 <th> </th> 511 511 <td> 512 <p><button class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Sessions' ); ?></button></p>512 <p><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Sessions' ); ?></button></p> 513 513 <p class="description"> 514 514 <?php -
tags/4.1.1/src/wp-includes/class-wp-customize-control.php
r59229 r59229 739 739 public function content_template() { 740 740 ?> 741 <label for="{{ data.settings .default}}-button">741 <label for="{{ data.settings['default'] }}-button"> 742 742 <# if ( data.label ) { #> 743 743 <span class="customize-control-title">{{ data.label }}</span> … … 776 776 <div class="actions"> 777 777 <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button> 778 <button type="button" class="button upload-button" id="{{ data.settings .default}}-button"><?php echo $this->button_labels['change']; ?></button>778 <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button> 779 779 <div style="clear:both"></div> 780 780 </div> … … 795 795 <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button> 796 796 <# } #> 797 <button type="button" class="button upload-button" id="{{ data.settings .default}}-button"><?php echo $this->button_labels['select']; ?></button>797 <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button> 798 798 <div style="clear:both"></div> 799 799 </div> -
tags/4.1.1/src/wp-includes/class-wp-customize-manager.php
r59229 r59229 64 64 65 65 /** 66 * $_POST values for Customize Settings.67 * 68 * @var array 66 * Unsanitized values for Customize Settings parsed from $_POST['customized']. 67 * 68 * @var array|false 69 69 */ 70 70 private $_post_values; … … 76 76 */ 77 77 public function __construct() { 78 require ( ABSPATH . WPINC . '/class-wp-customize-setting.php' );79 require ( ABSPATH . WPINC . '/class-wp-customize-panel.php' );80 require ( ABSPATH . WPINC . '/class-wp-customize-section.php' );81 require ( ABSPATH . WPINC . '/class-wp-customize-control.php' );82 require ( ABSPATH . WPINC . '/class-wp-customize-widgets.php' );78 require_once( ABSPATH . WPINC . '/class-wp-customize-setting.php' ); 79 require_once( ABSPATH . WPINC . '/class-wp-customize-panel.php' ); 80 require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' ); 81 require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' ); 82 require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' ); 83 83 84 84 $this->widgets = new WP_Customize_Widgets( $this ); … … 400 400 401 401 /** 402 * Decode the $_POST['customized'] values for a specific Customize Setting. 403 * 404 * @since 3.4.0 402 * Parse the incoming $_POST['customized'] JSON data and store the unsanitized 403 * settings for subsequent post_value() lookups. 404 * 405 * @since 4.1.1 406 * 407 * @return array 408 */ 409 public function unsanitized_post_values() { 410 if ( ! isset( $this->_post_values ) ) { 411 if ( isset( $_POST['customized'] ) ) { 412 $this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true ); 413 } 414 if ( empty( $this->_post_values ) ) { // if not isset or of JSON error 415 $this->_post_values = false; 416 } 417 } 418 if ( empty( $this->_post_values ) ) { 419 return array(); 420 } else { 421 return $this->_post_values; 422 } 423 } 424 425 /** 426 * Return the sanitized value for a given setting from the request's POST data. 427 * 428 * @since 3.4.0 429 * @since 4.1.1 Introduced 'default' parameter. 405 430 * 406 431 * @param WP_Customize_Setting $setting A WP_Customize_Setting derived object 407 * @return string $post_value Sanitized value 408 */ 409 public function post_value( $setting ) { 410 if ( ! isset( $this->_post_values ) ) { 411 if ( isset( $_POST['customized'] ) ) 412 $this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true ); 413 else 414 $this->_post_values = false; 415 } 416 417 if ( isset( $this->_post_values[ $setting->id ] ) ) 418 return $setting->sanitize( $this->_post_values[ $setting->id ] ); 432 * @param mixed $default value returned $setting has no post value (added in 4.2.0). 433 * @return string|mixed $post_value Sanitized value or the $default provided 434 */ 435 public function post_value( $setting, $default = null ) { 436 $post_values = $this->unsanitized_post_values(); 437 if ( array_key_exists( $setting->id, $post_values ) ) { 438 return $setting->sanitize( $post_values[ $setting->id ] ); 439 } else { 440 return $default; 441 } 419 442 } 420 443 -
tags/4.1.1/src/wp-includes/class-wp-customize-setting.php
r59229 r59229 104 104 } 105 105 106 protected $_original_value; 107 106 108 /** 107 109 * Handle previewing the setting. … … 110 112 */ 111 113 public function preview() { 114 if ( ! isset( $this->_original_value ) ) { 115 $this->_original_value = $this->value(); 116 } 117 112 118 switch( $this->type ) { 113 119 case 'theme_mod' : … … 160 166 */ 161 167 public function _preview_filter( $original ) { 162 return $this->multidimensional_replace( $original, $this->id_data[ 'keys' ], $this->post_value() ); 168 $undefined = new stdClass(); // symbol hack 169 $post_value = $this->manager->post_value( $this, $undefined ); 170 if ( $undefined === $post_value ) { 171 $value = $this->_original_value; 172 } else { 173 $value = $post_value; 174 } 175 176 return $this->multidimensional_replace( $original, $this->id_data['keys'], $value ); 163 177 } 164 178 … … 426 440 } 427 441 428 if ( $create && ! isset( $node[ $last ] ) ) 429 $node[ $last ] = array(); 442 if ( $create ) { 443 if ( ! is_array( $node ) ) { 444 // account for an array overriding a string or object value 445 $node = array(); 446 } 447 if ( ! isset( $node[ $last ] ) ) { 448 $node[ $last ] = array(); 449 } 450 } 430 451 431 452 if ( ! isset( $node[ $last ] ) ) -
tags/4.1.1/src/wp-includes/date.php
r59229 r59229 306 306 // Days per year. 307 307 if ( array_key_exists( 'year', $date_query ) ) { 308 // If a year exists in the date query, we can use it to get the days. 309 $max_days_of_year = date( 'z', mktime( 0, 0, 0, 12, 31, $date_query['year'] ) ) + 1; 308 /* 309 * If a year exists in the date query, we can use it to get the days. 310 * If multiple years are provided (as in a BETWEEN), use the first one. 311 */ 312 if ( is_array( $date_query['year'] ) ) { 313 $_year = reset( $date_query['year'] ); 314 } else { 315 $_year = $date_query['year']; 316 } 317 318 $max_days_of_year = date( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1; 310 319 } else { 311 320 // otherwise we use the max of 366 (leap-year) … … 337 346 338 347 // Weeks per year. 339 if ( array_key_exists( 'year', $date_query) ) {348 if ( isset( $_year ) ) { 340 349 // If we have a specific year, use it to calculate number of weeks. 341 350 $date = new DateTime(); 342 $date->setISODate( $ date_query['year'], 53 );351 $date->setISODate( $_year, 53 ); 343 352 $week_count = $date->format( "W" ) === "53" ? 53 : 52; 344 353 … … 361 370 // Hours per day. 362 371 $min_max_checks['hour'] = array( 363 'min' => 1,372 'min' => 0, 364 373 'max' => 23 365 374 ); … … 383 392 } 384 393 385 $is_between = $date_query[ $key ] >= $check['min'] && $date_query[ $key ] <= $check['max']; 386 387 if ( ! $is_between ) { 388 389 $error = sprintf( 390 /* translators: Date query invalid date message: 1: invalid value, 2: type of value, 3: minimum valid value, 4: maximum valid value */ 391 __( 'Invalid value %1$s for %2$s. Expected value should be between %3$s and %4$s.' ), 392 '<code>' . esc_html( $date_query[ $key ] ) . '</code>', 393 '<code>' . esc_html( $key ) . '</code>', 394 '<code>' . esc_html( $check['min'] ) . '</code>', 395 '<code>' . esc_html( $check['max'] ) . '</code>' 396 ); 397 398 _doing_it_wrong( __CLASS__, $error, '4.1.0' ); 399 400 $valid = false; 394 // Throw a notice for each failing value. 395 $is_between = true; 396 foreach ( (array) $date_query[ $key ] as $_value ) { 397 $is_between = $_value >= $check['min'] && $_value <= $check['max']; 398 399 if ( ! is_numeric( $_value ) || ! $is_between ) { 400 $error = sprintf( 401 /* translators: Date query invalid date message: 1: invalid value, 2: type of value, 3: minimum valid value, 4: maximum valid value */ 402 __( 'Invalid value %1$s for %2$s. Expected value should be between %3$s and %4$s.' ), 403 '<code>' . esc_html( $_value ) . '</code>', 404 '<code>' . esc_html( $key ) . '</code>', 405 '<code>' . esc_html( $check['min'] ) . '</code>', 406 '<code>' . esc_html( $check['max'] ) . '</code>' 407 ); 408 409 _doing_it_wrong( __CLASS__, $error, '4.1.0' ); 410 411 $valid = false; 412 } 401 413 } 402 414 } -
tags/4.1.1/src/wp-includes/general-template.php
r59229 r59229 2588 2588 global $wp_query, $wp_rewrite; 2589 2589 2590 $total = ( isset( $wp_query->max_num_pages ) ) ? $wp_query->max_num_pages : 1; 2591 $current = ( get_query_var( 'paged' ) ) ? intval( get_query_var( 'paged' ) ) : 1; 2590 // Setting up default values based on the current URL. 2592 2591 $pagenum_link = html_entity_decode( get_pagenum_link() ); 2593 $query_args = array();2594 2592 $url_parts = explode( '?', $pagenum_link ); 2595 2593 2596 if ( isset( $url_parts[1] ) ) {2597 wp_parse_str( $url_parts[1], $query_args );2598 $query_args = urlencode_deep( $query_args );2599 } 2600 2601 $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );2602 $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; 2603 2594 // Get max pages and current page out of the current query, if available. 2595 $total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1; 2596 $current = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; 2597 2598 // Append the format placeholder to the base URL. 2599 $pagenum_link = trailingslashit( $url_parts[0] ) . '%_%'; 2600 2601 // URL base depends on permalink settings. 2604 2602 $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; 2605 2603 $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; … … 2617 2615 'mid_size' => 2, 2618 2616 'type' => 'plain', 2619 'add_args' => $query_args, // array of query args to add2617 'add_args' => array(), // array of query args to add 2620 2618 'add_fragment' => '', 2621 2619 'before_page_number' => '', … … 2625 2623 $args = wp_parse_args( $args, $defaults ); 2626 2624 2625 if ( ! is_array( $args['add_args'] ) ) { 2626 $args['add_args'] = array(); 2627 } 2628 2629 // Merge additional query vars found in the original URL into 'add_args' array. 2630 if ( isset( $url_parts[1] ) ) { 2631 // Find the format argument. 2632 $format_query = parse_url( str_replace( '%_%', $args['format'], $args['base'] ), PHP_URL_QUERY ); 2633 wp_parse_str( $format_query, $format_arg ); 2634 2635 // Remove the format argument from the array of query arguments, to avoid overwriting custom format. 2636 wp_parse_str( remove_query_arg( array_keys( $format_arg ), $url_parts[1] ), $query_args ); 2637 $args['add_args'] = array_merge( $args['add_args'], urlencode_deep( $query_args ) ); 2638 } 2639 2627 2640 // Who knows what else people pass in $args 2628 2641 $total = (int) $args['total']; … … 2639 2652 $mid_size = 2; 2640 2653 } 2641 $add_args = is_array( $args['add_args'] ) ? $args['add_args'] : false;2654 $add_args = $args['add_args']; 2642 2655 $r = ''; 2643 2656 $page_links = array(); … … 3114 3127 return $settings; 3115 3128 } 3129 3130 /** 3131 * Temporary function to add a missing style rule to the themes page. 3132 * This avoids the need to ship an entirely rebuilt wp-admin.css in partial builds. 3133 * 3134 * @since 4.1.1 3135 * @ignore 3136 */ 3137 function _wp_add_themesphp_notice_styling() { 3138 global $pagenow; 3139 if ( 'themes.php' == $pagenow ) { 3140 echo "<style type='text/css'>.themes-php div.notice { margin: 0 0 20px 0; clear: both; }</style>\n"; 3141 } 3142 } 3143 add_action( 'admin_head', '_wp_add_themesphp_notice_styling' ); -
tags/4.1.1/src/wp-includes/js/media-audiovideo.js
r59229 r59229 54 54 55 55 if ( 'native' !== t.media.pluginType ) { 56 t. media.remove();56 t.$media.remove(); 57 57 } 58 58 -
tags/4.1.1/src/wp-includes/js/media-grid.js
r59229 r59229 299 299 this.$( 'audio, video' ).each( function (i, elem) { 300 300 var el = media.view.MediaDetails.prepareSrc( elem ); 301 new MediaElementPlayer( el, media.mixin.mejsSettings ); 301 setTimeout( function() { 302 new MediaElementPlayer( el, media.mixin.mejsSettings ); 303 }, 0 ); 302 304 } ); 303 305 } -
tags/4.1.1/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r59229 r59229 186 186 toolbarWidth = toolbarNode.offsetWidth; 187 187 toolbarHalf = toolbarWidth / 2; 188 iframe = editor.getContentAreaContainer().firstChild;188 iframe = document.getElementById( editor.id + '_ifr' ); 189 189 iframePos = DOM.getPos( iframe ); 190 190 iframeWidth = iframe.offsetWidth; … … 239 239 left += iframePos.x; 240 240 241 if ( toolbarWidth >= windowWidth ) { 241 if ( boundary.left < 0 || boundary.right > iframeWidth ) { 242 left = iframePos.x + ( iframeWidth - toolbarWidth ) / 2; 243 } else if ( toolbarWidth >= windowWidth ) { 242 244 className += ' mce-arrow-full'; 243 245 left = 0; -
tags/4.1.1/src/wp-includes/link-template.php
r59229 r59229 2311 2311 $args = wp_parse_args( $args, array( 2312 2312 'mid_size' => 1, 2313 'prev_text' => _ _( 'Previous' ),2314 'next_text' => _ _( 'Next' ),2313 'prev_text' => _x( 'Previous', 'previous post' ), 2314 'next_text' => _x( 'Next', 'next post' ), 2315 2315 'screen_reader_text' => __( 'Posts navigation' ), 2316 2316 ) ); -
tags/4.1.1/src/wp-includes/script-loader.php
r59229 r59229 178 178 $scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 ); 179 179 $scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 ); 180 $scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core' ), '1.11.2', 1 );180 $scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-scale'), '1.11.2', 1 ); 181 181 $scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 ); 182 $scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core' ), '1.11.2', 1 );182 $scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core', 'jquery-effects-size'), '1.11.2', 1 ); 183 183 $scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 ); 184 184 $scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 ); -
tags/4.1.1/src/wp-includes/taxonomy.php
r59229 r59229 3354 3354 3355 3355 // Check for duplicate slug 3356 $ id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE slug = %s", $slug ));3357 if ( $ id && ($id != $term_id)) {3356 $duplicate = get_term_by( 'slug', $slug, $taxonomy ); 3357 if ( $duplicate && $duplicate->term_id != $term_id ) { 3358 3358 // If an empty slug was passed or the parent changed, reset the slug to something unique. 3359 3359 // Otherwise, bail. … … 4337 4337 * 4338 4338 * @since 3.1.0 4339 * @since 4.1.1 Introduced the `$resource_type` parameter. 4339 4340 * 4340 4341 * @param array $ancestors An array of object ancestors. … … 4343 4344 * @param string $resource_type Type of resource $object_type is. 4344 4345 */ 4345 return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type );4346 return apply_filters( 'get_ancestors', $ancestors, $object_id, $object_type, $resource_type ); 4346 4347 } 4347 4348 -
tags/4.1.1/src/wp-includes/update.php
r59229 r59229 522 522 523 523 if ( $plugins = current_user_can( 'update_plugins' ) ) { 524 wp_update_plugins(); // Check for Plugin updates525 524 $update_plugins = get_site_transient( 'update_plugins' ); 526 525 if ( ! empty( $update_plugins->response ) ) … … 529 528 530 529 if ( $themes = current_user_can( 'update_themes' ) ) { 531 wp_update_themes(); // Check for Theme updates532 530 $update_themes = get_site_transient( 'update_themes' ); 533 531 if ( ! empty( $update_themes->response ) ) -
tags/4.1.1/src/wp-includes/version.php
r59229 r59229 5 5 * @global string $wp_version 6 6 */ 7 $wp_version = '4.1 -src';7 $wp_version = '4.1.1-src'; 8 8 9 9 /** … … 19 19 * @global string $tinymce_version 20 20 */ 21 $tinymce_version = '4107-201 41130';21 $tinymce_version = '4107-20150118'; 22 22 23 23 /** -
tags/4.1.1/tests/phpunit/tests/date/query.php
r59229 r59229 858 858 public function test_validate_date_values_hour() { 859 859 // Valid values. 860 $hours = range( 1, 23 );860 $hours = range( 0, 23 ); 861 861 foreach ( $hours as $hour ) { 862 862 $this->assertTrue( $this->q->validate_date_values( array( 'hour' => $hour ) ) ); … … 864 864 865 865 // Invalid values. 866 $hours = array( -1, 24, 25, 'string who wants to be a int' );866 $hours = array( -1, 24, 25, 'string' ); 867 867 foreach ( $hours as $hour ) { 868 868 $this->assertFalse( $this->q->validate_date_values( array( 'hour' => $hour ) ) ); … … 961 961 } 962 962 963 /** 964 * @ticket 31001 965 */ 966 public function test_validate_date_values_should_process_array_value_for_year() { 967 $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) ); 968 $p2 = $this->factory->post->create( array( 'post_date' => '2013-01-12' ) ); 969 970 $q = new WP_Query( array( 971 'date_query' => array( 972 array( 973 'compare' => 'BETWEEN', 974 'year' => array( 2012, 2014 ), 975 ), 976 ), 977 'fields' => 'ids', 978 ) ); 979 980 $this->assertEquals( array( $p2 ), $q->posts ); 981 } 982 983 /** 984 * @ticket 31001 985 */ 986 public function test_validate_date_values_should_process_array_value_for_day() { 987 $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) ); 988 $p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10' ) ); 989 990 $q = new WP_Query( array( 991 'date_query' => array( 992 array( 993 'compare' => 'BETWEEN', 994 'day' => array( 9, 11 ), 995 ), 996 ), 997 'fields' => 'ids', 998 ) ); 999 1000 $this->assertEquals( array( $p2 ), $q->posts ); 1001 } 1002 1003 /** 1004 * @ticket 31001 1005 * @expectedIncorrectUsage WP_Date_Query 1006 */ 1007 public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() { 1008 $p1 = $this->factory->post->create( array( 'post_date' => '2015-01-12' ) ); 1009 $p2 = $this->factory->post->create( array( 'post_date' => '2015-01-10' ) ); 1010 1011 $q = new WP_Query( array( 1012 'date_query' => array( 1013 array( 1014 'compare' => 'BETWEEN', 1015 'day' => array( 9, 32 ), 1016 ), 1017 ), 1018 'fields' => 'ids', 1019 ) ); 1020 1021 // MySQL ignores the invalid clause. 1022 $this->assertEquals( array( $p1, $p2 ), $q->posts ); 1023 } 1024 963 1025 /** Helpers **********************************************************/ 964 1026 -
tags/4.1.1/tests/phpunit/tests/general/paginateLinks.php
r59229 r59229 230 230 } 231 231 } 232 233 /** 234 * @ticket 30831 235 */ 236 function test_paginate_links_with_custom_query_args() { 237 add_filter( 'get_pagenum_link', array( $this, 'add_query_arg' ) ); 238 $links = paginate_links( array( 239 'current' => 2, 240 'total' => 5, 241 'end_size' => 1, 242 'mid_size' => 1, 243 'type' => 'array', 244 'add_args' => array( 245 'baz' => 'qux', 246 ), 247 ) ); 248 remove_filter( 'get_pagenum_link', array( $this, 'add_query_arg' ) ); 249 250 $document = new DOMDocument(); 251 $document->preserveWhiteSpace = false; 252 253 $data = array( 254 0 => home_url( '/?baz=qux&foo=bar&s=search+term' ), 255 1 => home_url( '/?baz=qux&foo=bar&s=search+term' ), 256 3 => home_url( '/?paged=3&baz=qux&foo=bar&s=search+term' ), 257 5 => home_url( '/?paged=5&baz=qux&foo=bar&s=search+term' ), 258 6 => home_url( '/?paged=3&baz=qux&foo=bar&s=search+term' ), 259 ); 260 261 foreach ( $data as $index => $expected_href ) { 262 $document->loadHTML( $links[ $index ] ); 263 $tag = $document->getElementsByTagName( 'a' )->item( 0 ); 264 $this->assertNotNull( $tag ); 265 266 $href = $tag->attributes->getNamedItem( 'href' )->value; 267 $this->assertEquals( $expected_href, $href ); 268 } 269 } 270 271 /** 272 * @ticket 30831 273 */ 274 public function test_paginate_links_should_allow_non_default_format_without_add_args() { 275 // Fake the query params. 276 $request_uri = $_SERVER['REQUEST_URI']; 277 $_SERVER['REQUEST_URI'] = add_query_arg( 'foo', 3, home_url() ); 278 279 $links = paginate_links( array( 280 'base' => add_query_arg( 'foo', '%#%' ), 281 'format' => '', 282 'total' => 5, 283 'current' => 3, 284 'type' => 'array', 285 ) ); 286 287 $this->assertContains( '?foo=1', $links[1] ); 288 $this->assertContains( '?foo=2', $links[2] ); 289 $this->assertContains( '?foo=4', $links[4] ); 290 $this->assertContains( '?foo=5', $links[5] ); 291 292 $_SERVER['REQUEST_URI'] = $request_uri; 293 } 294 295 /** 296 * @ticket 30831 297 */ 298 public function test_paginate_links_should_allow_add_args_to_be_bool_false() { 299 // Fake the query params. 300 $request_uri = $_SERVER['REQUEST_URI']; 301 $_SERVER['REQUEST_URI'] = add_query_arg( 'foo', 3, home_url() ); 302 303 $links = paginate_links( array( 304 'add_args' => false, 305 'base' => add_query_arg( 'foo', '%#%' ), 306 'format' => '', 307 'total' => 5, 308 'current' => 3, 309 'type' => 'array', 310 ) ); 311 312 $this->assertContains( "<span class='page-numbers current'>3</span>", $links ); 313 } 232 314 } -
tags/4.1.1/tests/phpunit/tests/term.php
r59229 r59229 641 641 * @ticket 5809 642 642 */ 643 public function test_wp_update_term_ duplicate_slug_same_taxonomy() {643 public function test_wp_update_term_should_not_create_duplicate_slugs_within_the_same_taxonomy() { 644 644 register_taxonomy( 'wptests_tax', 'post' ); 645 645 … … 651 651 652 652 $t2 = $this->factory->term->create( array( 653 'name' => ' Foo',653 'name' => 'Bar', 654 654 'slug' => 'bar', 655 655 'taxonomy' => 'wptests_tax', … … 667 667 * @ticket 5809 668 668 */ 669 public function test_wp_update_term_ duplicate_slug_different_taxonomy() {669 public function test_wp_update_term_should_allow_duplicate_slugs_in_different_taxonomy() { 670 670 register_taxonomy( 'wptests_tax', 'post' ); 671 671 register_taxonomy( 'wptests_tax_2', 'post' ); … … 687 687 ) ); 688 688 689 $this->assertWPError( $updated ); 690 $this->assertSame( 'duplicate_term_slug', $updated->get_error_code() ); 689 $this->assertFalse( is_wp_error( $updated ) ); 690 691 $t1_term = get_term( $t1, 'wptests_tax' ); 692 $t2_term = get_term( $t2, 'wptests_tax_2' ); 693 $this->assertSame( $t1_term->slug, $t2_term->slug ); 694 } 695 696 /** 697 * @ticket 30780 698 */ 699 public function test_wp_update_term_should_allow_duplicate_names_in_different_taxonomies() { 700 register_taxonomy( 'wptests_tax', 'post' ); 701 register_taxonomy( 'wptests_tax_2', 'post' ); 702 703 $t1 = $this->factory->term->create( array( 704 'name' => 'Foo', 705 'slug' => 'foo', 706 'taxonomy' => 'wptests_tax', 707 ) ); 708 709 $t2 = $this->factory->term->create( array( 710 'name' => 'Bar', 711 'slug' => 'bar', 712 'taxonomy' => 'wptests_tax_2', 713 ) ); 714 715 $updated = wp_update_term( $t2, 'wptests_tax_2', array( 716 'name' => 'Foo', 717 ) ); 718 719 $this->assertFalse( is_wp_error( $updated ) ); 720 721 $t2_term = get_term( $t2, 'wptests_tax_2' ); 722 $this->assertSame( 'Foo', $t2_term->name ); 723 } 724 725 /** 726 * @ticket 30780 727 */ 728 public function test_wp_update_term_should_allow_duplicate_names_at_different_levels_of_the_same_taxonomy() { 729 register_taxonomy( 'wptests_tax', 'post', array( 730 'hierarchical' => true, 731 ) ); 732 733 $t1 = $this->factory->term->create( array( 734 'name' => 'Foo', 735 'slug' => 'foo', 736 'taxonomy' => 'wptests_tax', 737 ) ); 738 739 $t2 = $this->factory->term->create( array( 740 'name' => 'Bar', 741 'slug' => 'bar', 742 'taxonomy' => 'wptests_tax', 743 'parent' => $t1, 744 ) ); 745 746 $t3 = $this->factory->term->create( array( 747 'name' => 'Bar Child', 748 'slug' => 'bar-child', 749 'taxonomy' => 'wptests_tax', 750 'parent' => $t2, 751 ) ); 752 753 $updated = wp_update_term( $t3, 'wptests_tax', array( 754 'name' => 'Bar', 755 ) ); 756 757 $this->assertFalse( is_wp_error( $updated ) ); 758 759 $t3_term = get_term( $t3, 'wptests_tax' ); 760 $this->assertSame( 'Bar', $t3_term->name ); 691 761 } 692 762 … … 1606 1676 } 1607 1677 1678 /** 1679 * @ticket 30780 1680 */ 1681 public function test_wp_update_term_should_assign_new_slug_when_reassigning_parent_as_long_as_there_is_no_other_term_with_the_same_slug() { 1682 register_taxonomy( 'wptests_tax', 'post', array( 1683 'hierarchical' => true, 1684 ) ); 1685 register_taxonomy( 'wptests_tax_2', 'post', array( 1686 'hierarchical' => true, 1687 ) ); 1688 1689 $t1 = $this->factory->term->create( array( 1690 'taxonomy' => 'wptests_tax', 1691 'slug' => 'parent-term', 1692 ) ); 1693 1694 $t2 = $this->factory->term->create( array( 1695 'taxonomy' => 'wptests_tax', 1696 'slug' => 'foo', 1697 ) ); 1698 1699 wp_update_term( $t2, 'wptests_tax', array( 1700 'parent' => $t1, 1701 ) ); 1702 1703 $t2_term = get_term( $t2, 'wptests_tax' ); 1704 1705 $this->assertSame( 'foo', $t2_term->slug ); 1706 1707 _unregister_taxonomy( 'wptests_tax' ); 1708 } 1709 1710 /** 1711 * @ticket 30780 1712 */ 1713 public function test_wp_update_term_should_not_assign_new_slug_when_reassigning_parent_as_long_as_there_is_no_other_slug_conflict_within_the_taxonomy() { 1714 register_taxonomy( 'wptests_tax', 'post', array( 1715 'hierarchical' => true, 1716 ) ); 1717 register_taxonomy( 'wptests_tax_2', 'post', array( 1718 'hierarchical' => true, 1719 ) ); 1720 1721 $t1 = $this->factory->term->create( array( 1722 'taxonomy' => 'wptests_tax', 1723 'slug' => 'parent-term', 1724 ) ); 1725 1726 // Same slug but in a different tax. 1727 $t2 = $this->factory->term->create( array( 1728 'taxonomy' => 'wptests_tax_2', 1729 'slug' => 'foo', 1730 ) ); 1731 1732 $t3 = $this->factory->term->create( array( 1733 'taxonomy' => 'wptests_tax', 1734 'slug' => 'foo', 1735 ) ); 1736 1737 wp_update_term( $t3, 'wptests_tax', array( 1738 'parent' => $t1, 1739 ) ); 1740 1741 $t3_term = get_term( $t3, 'wptests_tax' ); 1742 1743 $this->assertSame( 'foo', $t3_term->slug ); 1744 1745 _unregister_taxonomy( 'wptests_tax' ); 1746 } 1747 1608 1748 /** Helpers **********************************************************/ 1609 1749
Note: See TracChangeset
for help on using the changeset viewer.