Commit 3c8e48c5 authored by lucha's avatar lucha

Wordpress 4.7.1

parent b418a265
WordPress - Web publishing software
Copyright 2011-2016 by the contributors
Copyright 2011-2017 by the contributors
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
......@@ -43,6 +43,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
</h2>
<div class="changelog point-releases">
<h3><?php _e( 'Maintenance and Security Release' ); ?></h3>
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 62 ), '4.7.1', number_format_i18n( 62 ) ); ?>
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.1' ); ?>
</p>
</div>
<div class="headline-feature feature-video">
<iframe width="1050" height="591" src="<?php echo esc_url( $video_url ); ?>" frameborder="0" allowfullscreen></iframe>
<script src="https://videopress.com/videopress-iframe.js"></script>
......
......@@ -811,7 +811,6 @@ li.assigned-to-menu-location .add-new-menu-item {
.menu-delete:hover,
.menu-delete:focus {
color: #f00;
text-decoration: none;
}
.menu-item-handle {
......
......@@ -811,7 +811,6 @@ li.assigned-to-menu-location .add-new-menu-item {
.menu-delete:hover,
.menu-delete:focus {
color: #f00;
text-decoration: none;
}
.menu-item-handle {
......
This diff is collapsed.
......@@ -1229,6 +1229,7 @@ table.links-table {
}
.focus-on .wrap > h1,
.focus-on .page-title-action,
.focus-on #wpfooter,
.focus-on .postbox-container > *,
.focus-on div.updated,
......@@ -1252,6 +1253,7 @@ table.links-table {
}
.focus-off .wrap > h1,
.focus-off .page-title-action,
.focus-off #wpfooter,
.focus-off .postbox-container > *,
.focus-off div.updated,
......
This diff is collapsed.
......@@ -1229,6 +1229,7 @@ table.links-table {
}
.focus-on .wrap > h1,
.focus-on .page-title-action,
.focus-on #wpfooter,
.focus-on .postbox-container > *,
.focus-on div.updated,
......@@ -1252,6 +1253,7 @@ table.links-table {
}
.focus-off .wrap > h1,
.focus-off .page-title-action,
.focus-off #wpfooter,
.focus-off .postbox-container > *,
.focus-off div.updated,
......
This diff is collapsed.
......@@ -81,7 +81,7 @@ case 'add-tag':
$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
if ( $ret && !is_wp_error( $ret ) )
$location = add_query_arg( 'message', 1, $location );
$location = add_query_arg( 'message', 1, $referer );
else
$location = add_query_arg( array( 'error' => true, 'message' => 4 ), $referer );
......
......@@ -915,7 +915,8 @@ final class WP_Screen {
switch ( $this->base ) {
case 'widgets':
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
$nonce = wp_create_nonce( 'widgets-access' );
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=' . urlencode( $nonce ) . '">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=' . urlencode( $nonce ) . '">' . __('Disable accessibility mode') . "</a></p>\n";
break;
case 'post' :
$expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
......
......@@ -221,14 +221,28 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
$fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );
$sizes = array();
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
foreach ( $fallback_sizes as $s ) {
$sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
$sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
$sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
} else {
$sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
}
if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
$sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
} else {
$sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
}
// Force thumbnails to be soft crops.
if ( ! 'thumbnail' === $s ) {
$sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
$sizes[ $s ]['crop'] = $_wp_additional_image_sizes[ $s ]['crop'];
} else {
// Force thumbnails to be soft crops.
if ( ! 'thumbnail' === $s ) {
$sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
}
}
}
......
......@@ -1154,35 +1154,6 @@ function wp_edit_attachments_query_vars( $q = false ) {
return $q;
}
/**
* Filter the SQL clauses of an attachment query to include filenames.
*
* @since 4.7.0
* @access private
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
* DISTINCT, fields (SELECT), and LIMITS clauses.
* @return array The modified clauses.
*/
function _filter_query_attachment_filenames( $clauses ) {
global $wpdb;
remove_filter( 'posts_clauses', __FUNCTION__ );
// Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.
$clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";
$clauses['groupby'] = "{$wpdb->posts}.ID";
$clauses['where'] = preg_replace(
"/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",
"$0 OR ( sq1.meta_value $1 $2 )",
$clauses['where'] );
return $clauses;
}
/**
* Executes a query for attachments. An array of WP_Query arguments
* can be passed in, which will override the arguments set by this function.
......
......@@ -5300,7 +5300,7 @@
} );
$textarea.on( 'keydown', function onKeydown( event ) {
var selectionStart, selectionEnd, value, scroll, tabKeyCode = 9, escKeyCode = 27;
var selectionStart, selectionEnd, value, tabKeyCode = 9, escKeyCode = 27;
if ( escKeyCode === event.keyCode ) {
if ( ! $textarea.data( 'next-tab-blurs' ) ) {
......@@ -5325,10 +5325,8 @@
value = textarea.value;
if ( selectionStart >= 0 ) {
scroll = $textarea.scrollTop;
textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
$textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
textarea.scrollTop = scroll;
}
event.stopPropagation();
......@@ -5367,16 +5365,20 @@
// Focus on the control that is associated with the given setting.
api.previewer.bind( 'focus-control-for-setting', function( settingId ) {
var matchedControl;
var matchedControls = [];
api.control.each( function( control ) {
var settingIds = _.pluck( control.settings, 'id' );
if ( -1 !== _.indexOf( settingIds, settingId ) ) {
matchedControl = control;
matchedControls.push( control );
}
} );
if ( matchedControl ) {
matchedControl.focus();
// Focus on the matched control with the lowest priority (appearing higher).
if ( matchedControls.length ) {
matchedControls.sort( function( a, b ) {
return a.priority() - b.priority();
} );
matchedControls[0].focus();
}
} );
......
This diff is collapsed.
......@@ -1169,7 +1169,11 @@
// @todo It would be better if this was added directly on the setting itself, as opposed to the control.
control.setting.validate = function( value ) {
return parseInt( value, 10 );
if ( '' === value ) {
return 0;
} else {
return parseInt( value, 10 );
}
};
// Edit menu button.
......
This diff is collapsed.
......@@ -806,7 +806,7 @@ themes.view.Details = wp.Backbone.View.extend({
$( document ).one( 'wp-theme-delete-success', function( event, response ) {
_this.$el.find( '.close' ).trigger( 'click' );
$( '[data-slug="' + response.slug + '"' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {
$( '[data-slug="' + response.slug + '"]' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {
$( this ).remove();
_themes.data.themes = _.without( _themes.data.themes, _.findWhere( _themes.data.themes, { id: response.slug } ) );
......
This diff is collapsed.
......@@ -1516,11 +1516,11 @@
* @param {string} message Error message.
*/
wp.updates.showErrorInCredentialsForm = function( message ) {
var $modal = $( '#request-filesystem-credentials-form' );
var $filesystemForm = $( '#request-filesystem-credentials-form' );
// Remove any existing error.
$modal.find( '.notice' ).remove();
$modal.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error"><p>' + message + '</p></div>' );
$filesystemForm.find( '.notice' ).remove();
$filesystemForm.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error"><p>' + message + '</p></div>' );
};
/**
......@@ -1670,6 +1670,7 @@
$( function() {
var $pluginFilter = $( '#plugin-filter' ),
$bulkActionForm = $( '#bulk-action-form' ),
$filesystemForm = $( '#request-filesystem-credentials-form' ),
$filesystemModal = $( '#request-filesystem-credentials-dialog' ),
$pluginSearch = $( '.plugins-php .wp-filter-search' ),
$pluginInstallSearch = $( '.plugin-install-php .wp-filter-search' );
......@@ -1725,7 +1726,7 @@
*
* @since 4.2.0
*/
$filesystemModal.on( 'change', 'input[name="connection_type"]', function() {
$filesystemForm.on( 'change', 'input[name="connection_type"]', function() {
$( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) );
} ).change();
......
This diff is collapsed.
......@@ -250,6 +250,8 @@ function list_plugin_updates() {
<tbody class="plugins">
<?php
foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
// Get plugin compat for running version of WordPress.
if ( isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $cur_wp_version, '>=') ) {
$compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
......
......@@ -22,6 +22,8 @@ if ( ! current_user_can( 'edit_theme_options' ) ) {
$widgets_access = get_user_setting( 'widgets_access' );
if ( isset($_GET['widgets-access']) ) {
check_admin_referer( 'widgets-access' );
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
set_user_setting( 'widgets_access', $widgets_access );
}
......
......@@ -2,7 +2,7 @@
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
Requires at least: 3.7
Tested up to: 4.6.1
Tested up to: 4.7
Stable tag: 3.2
License: GPLv2 or later
......
=== Twenty Seventeen ===
Contributors: the WordPress team
Requires at least: WordPress 4.8-trunk
Requires at least: WordPress 4.7
Tested up to: WordPress 4.7
Version: 1.0
Version: 1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
......@@ -60,6 +60,14 @@ Source: https://unsplash.com/@englr?photo=bIhpiQA009k
== Changelog ==
= 1.1 =
* Released: January 6, 2017
- Fix incorrect $content_width value in theme
- Ensure functions in customize-controls.js don't count on Customizer sections always being present
- Deprecate page_home nav menu item starter content
- Introduce a theme-specific filter twentyseventeen_starter_content for customizing the starter content array
= 1.0 =
* Released: December 6, 2016
......
......@@ -25,10 +25,12 @@
});
// Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly.
wp.customize.section( 'theme_options' ).expanded.bind( function( isExpanding ) {
wp.customize.section( 'theme_options', function( section ) {
section.expanded.bind( function( isExpanding ) {
// Value of isExpanding will = true if you're entering the section, false if you're leaving it.
wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding });
});
// Value of isExpanding will = true if you're entering the section, false if you're leaving it.
wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding });
} );
} );
});
})( jQuery );
......@@ -55,6 +55,9 @@ function twentyseventeen_setup() {
add_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true );
// Set the default content width.
$GLOBALS['content_width'] = 525;
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'top' => __( 'Top Menu', 'twentyseventeen' ),
......@@ -103,24 +106,29 @@ function twentyseventeen_setup() {
*/
add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) );
add_theme_support( 'starter-content', array(
// Define and register starter content to showcase the theme on new sites.
$starter_content = array(
'widgets' => array(
// Place three core-defined widgets in the sidebar area.
'sidebar-1' => array(
'text_business_info',
'search',
'text_about',
),
// Add the core-defined business info widget to the footer 1 area.
'sidebar-2' => array(
'text_business_info',
),
// Put two core-defined widgets in the footer 2 area.
'sidebar-3' => array(
'text_about',
'search',
),
),
// Specify the core-defined pages to create and add custom thumbnails to some of them.
'posts' => array(
'home',
'about' => array(
......@@ -137,10 +145,11 @@ function twentyseventeen_setup() {
),
),
// Create the custom image attachments used as post thumbnails for pages.
'attachments' => array(
'image-espresso' => array(
'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ),
'file' => 'assets/images/espresso.jpg',
'file' => 'assets/images/espresso.jpg', // URL relative to the template directory.
),
'image-sandwich' => array(
'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ),
......@@ -152,12 +161,14 @@ function twentyseventeen_setup() {
),
),
// Default to a static front page and assign the front and posts pages.
'options' => array(
'show_on_front' => 'page',
'page_on_front' => '{{home}}',
'page_for_posts' => '{{blog}}',
),
// Set the front page section theme mods to the IDs of the core-registered pages.
'theme_mods' => array(
'panel_1' => '{{homepage-section}}',
'panel_2' => '{{about}}',
......@@ -165,16 +176,20 @@ function twentyseventeen_setup() {
'panel_4' => '{{contact}}',
),
// Set up nav menus for each of the two areas registered in the theme.
'nav_menus' => array(
// Assign a menu to the "top" location.
'top' => array(
'name' => __( 'Top Menu', 'twentyseventeen' ),
'items' => array(
'page_home',
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
'page_about',
'page_blog',
'page_contact',
),
),
// Assign a menu to the "social" location.
'social' => array(
'name' => __( 'Social Links Menu', 'twentyseventeen' ),
'items' => array(
......@@ -186,7 +201,18 @@ function twentyseventeen_setup() {
),
),
),
) );
);
/**
* Filters Twenty Seventeen array of starter content.
*
* @since Twenty Seventeen 1.1
*
* @param array $starter_content Array of starter content.
*/
$starter_content = apply_filters( 'twentyseventeen_starter_content', $starter_content );
add_theme_support( 'starter-content', $starter_content );
}
add_action( 'after_setup_theme', 'twentyseventeen_setup' );
......@@ -199,10 +225,23 @@ add_action( 'after_setup_theme', 'twentyseventeen_setup' );
*/
function twentyseventeen_content_width() {
$content_width = 700;
$content_width = $GLOBALS['content_width'];
// Get layout.
$page_layout = get_theme_mod( 'page_layout' );
// Check if layout is one column.
if ( 'one-column' === $page_layout ) {
if ( twentyseventeen_is_frontpage() ) {
$content_width = 644;
} elseif ( is_page() ) {
$content_width = 740;
}
}
if ( twentyseventeen_is_frontpage() ) {
$content_width = 1120;
// Check if is single post and there is no sidebar.
if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) {
$content_width = 740;
}
/**
......@@ -214,7 +253,7 @@ function twentyseventeen_content_width() {
*/
$GLOBALS['content_width'] = apply_filters( 'twentyseventeen_content_width', $content_width );
}
add_action( 'after_setup_theme', 'twentyseventeen_content_width', 0 );
add_action( 'template_redirect', 'twentyseventeen_content_width', 0 );
/**
* Register custom fonts.
......
......@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyseventeen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
Version: 1.0
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentyseventeen
......
This diff is collapsed.
......@@ -30,7 +30,7 @@ class SMTP
* The PHPMailer SMTP version number.
* @var string
*/
const VERSION = '5.2.14';
const VERSION = '5.2.22';
/**
* SMTP line break constant.
......@@ -81,7 +81,7 @@ class SMTP
* @deprecated Use the `VERSION` constant instead
* @see SMTP::VERSION
*/
public $Version = '5.2.14';
public $Version = '5.2.22';
/**
* SMTP server port number.
......@@ -150,6 +150,17 @@ class SMTP
*/
public $Timelimit = 300;
/**
* @var array patterns to extract smtp transaction id from smtp reply
* Only first capture group will be use, use non-capturing group to deal with it
* Extend this class to override this property to fulfil your needs.
*/
protected $smtp_transaction_id_patterns = array(
'exim' => '/[0-9]{3} OK id=(.*)/',
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
);
/**
* The socket for the server connection.
* @var resource
......@@ -206,7 +217,7 @@ class SMTP
}
//Avoid clash with built-in function names
if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
call_user_func($this->Debugoutput, $str, $this->do_debug);
call_user_func($this->Debugoutput, $str, $level);
return;
}
switch ($this->Debugoutput) {
......@@ -272,8 +283,8 @@ class SMTP
$errstr = '';
if ($streamok) {
$socket_context = stream_context_create($options);
//Suppress errors; connection failures are handled at a higher level
$this->smtp_conn = @stream_socket_client(
set_error_handler(array($this, 'errorHandler'));
$this->smtp_conn = stream_socket_client(
$host . ":" . $port,
$errno,
$errstr,
......@@ -281,12 +292,14 @@ class SMTP
STREAM_CLIENT_CONNECT,
$socket_context
);
restore_error_handler();
} else {
//Fall back to fsockopen which should work in more places, but is missing some features
$this->edebug(
"Connection: stream_socket_client not available, falling back to fsockopen",
self::DEBUG_CONNECTION
);
set_error_handler(array($this, 'errorHandler'));
$this->smtp_conn = fsockopen(
$host,
$port,
......@@ -294,6 +307,7 @@ class SMTP
$errstr,
$timeout
);
restore_error_handler();
}
// Verify we connected properly
if (!is_resource($this->smtp_conn)) {
......@@ -336,11 +350,22 @@ class SMTP
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
return false;
}
//Allow the best TLS version(s) we can
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
//so add them back in manually if we can
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
// Begin encrypted connection
if (!stream_socket_enable_crypto(
$this->smtp_conn,
true,
STREAM_CRYPTO_METHOD_TLS_CLIENT
$crypto_method
)) {
return false;
}
......@@ -353,7 +378,7 @@ class SMTP
* @see hello()