Compare commits
100 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56d86ab29a | ||
|
|
95b51d858b | ||
|
|
bb73cd874b | ||
|
|
17441829da | ||
|
|
33bf516808 | ||
|
|
a21c779e19 | ||
|
|
51f3fe2909 | ||
|
|
1897b61ccb | ||
|
|
fa7cb2645f | ||
|
|
a5ea8d5b6e | ||
|
|
00334dd771 | ||
|
|
6751b328d9 | ||
|
|
2e807302cd | ||
|
|
46c23960dc | ||
|
|
cddad9e7ee | ||
|
|
d9d2157746 | ||
|
|
1b04a6684f | ||
|
|
266b85e544 | ||
|
|
f6e6b58725 | ||
|
|
b1b62d3ccd | ||
|
|
90cd7353b3 | ||
|
|
abebce20a6 | ||
|
|
15294da073 | ||
|
|
624ab728c7 | ||
|
|
a06e0059b1 | ||
|
|
ed440a7cf4 | ||
|
|
df15e2febb | ||
|
|
8236eda6c6 | ||
|
|
86a3e6e871 | ||
|
|
bb6bf42e24 | ||
|
|
c99a87604c | ||
|
|
180d083620 | ||
|
|
5c4b8e4eae | ||
|
|
98e3e2e137 | ||
|
|
5d6b13a4d9 | ||
|
|
a240058e32 | ||
|
|
89394fe908 | ||
|
|
22b3c1f229 | ||
|
|
44d86f67b4 | ||
|
|
a0e40393b4 | ||
|
|
20d0563a9b | ||
|
|
311404b841 | ||
|
|
a939b84057 | ||
|
|
4b5e93ba40 | ||
|
|
f1f6b9c2d6 | ||
|
|
032feff801 | ||
|
|
7da41242f9 | ||
|
|
8b8783a10f | ||
|
|
9046c96d95 | ||
|
|
fdedd97120 | ||
|
|
9631f83b6f | ||
|
|
dd8b7de724 | ||
|
|
eb0bd01048 | ||
|
|
224efaf1e0 | ||
|
|
f6115d3bfe | ||
|
|
424c4d9a59 | ||
|
|
a2cf26ef40 | ||
|
|
693913d6b0 | ||
|
|
04a2a43a09 | ||
|
|
0e19241593 | ||
|
|
20596916c3 | ||
|
|
0b2de83d41 | ||
|
|
286bf05ea7 | ||
|
|
5e34f4344f | ||
|
|
cbcc1cbaa3 | ||
|
|
540e1f84bc | ||
|
|
5bb3476a4a | ||
|
|
9c57f3a429 | ||
|
|
f72b21af23 | ||
|
|
f91a5fd10e | ||
|
|
5fe5a0eb07 | ||
|
|
12b08da9c2 | ||
|
|
cca265971e | ||
|
|
bf8ffcc14e | ||
|
|
bff564ee35 | ||
|
|
17ae4e9fb9 | ||
|
|
9f25a307f5 | ||
|
|
b04ce4a437 | ||
|
|
2a95fc38b2 | ||
|
|
e52a25130a | ||
|
|
a10c2ba8f3 | ||
|
|
26093bdc3e | ||
|
|
de170f4c55 | ||
|
|
e1149c9ff1 | ||
|
|
516ee5f231 | ||
|
|
8c51f55fdd | ||
|
|
5b643782b6 | ||
|
|
d8ab8aa97c | ||
|
|
7e56cfc30a | ||
|
|
758d53b709 | ||
|
|
00342ece4a | ||
|
|
23ef1979f6 | ||
|
|
e7bb78b884 | ||
|
|
7f29687a55 | ||
|
|
f0706a0895 | ||
|
|
7cfe2d293f | ||
|
|
4e96fc9fd7 | ||
|
|
0b648f198b | ||
|
|
7f86f37642 | ||
|
|
cf4e51f442 |
@@ -1,6 +1,6 @@
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2015 by the contributors
|
||||
Copyright 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
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<h1 id="logo">
|
||||
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
|
||||
<br /> Version 4.3
|
||||
<br /> Version 4.3.11
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ $tech_features = array(
|
||||
array(
|
||||
'heading' => __( 'Template Hierarchy' ),
|
||||
/* Translators: 1: singular.php; 2: single.php; 3:page.php */
|
||||
'description' => sprintf( __( 'Added %1$s as a fallback for %2$s and %3$s' ), '<code>singular.php</code>', '<code>single.php</code>', '<code>page.php</code>.' ),
|
||||
'description' => sprintf( __( 'Added %1$s as a fallback for %2$s and %3$s' ), '<code>singular.php</code>', '<code>single.php</code>', '<code>page.php</code>' ),
|
||||
),
|
||||
array(
|
||||
'heading' => '<code>WP_List_Table</code>',
|
||||
@@ -107,6 +107,54 @@ $tech_features = array(
|
||||
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 11 ); ?></h3>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 5 ), '4.3.11' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.11' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '4.3.10', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.10' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '4.3.9' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.9' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 3 ), '4.3.8' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.8' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 8 ), '4.3.7' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.7' ); ?>
|
||||
</p>
|
||||
<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.', 1 ), '4.3.6', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.6' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 7 ), '4.3.5' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.5' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 7 ), '4.3.4' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.4' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '4.3.3' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.3' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.', 5 ), '4.3.2', number_format_i18n( 5 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.2' ); ?>
|
||||
</p>
|
||||
<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.', 26 ), '4.3.1', number_format_i18n( 26 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.3.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>
|
||||
|
||||
@@ -609,6 +609,8 @@
|
||||
border-right: none;
|
||||
border-left: none;
|
||||
background: #fff;
|
||||
-webkit-transition: background-color 0.15s;
|
||||
transition: background-color 0.15s;
|
||||
}
|
||||
|
||||
#available-menu-items .open .accordion-section-title,
|
||||
@@ -700,7 +702,6 @@ button.not-a-button {
|
||||
#available-menu-items .accordion-section-content {
|
||||
padding: 1px 15px 15px 15px;
|
||||
margin: 0;
|
||||
min-height: 120px;
|
||||
max-height: 290px;
|
||||
}
|
||||
|
||||
|
||||
2
wp-admin/css/customize-nav-menus-rtl.min.css
vendored
2
wp-admin/css/customize-nav-menus-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -609,6 +609,8 @@
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
background: #fff;
|
||||
-webkit-transition: background-color 0.15s;
|
||||
transition: background-color 0.15s;
|
||||
}
|
||||
|
||||
#available-menu-items .open .accordion-section-title,
|
||||
@@ -700,7 +702,6 @@ button.not-a-button {
|
||||
#available-menu-items .accordion-section-content {
|
||||
padding: 1px 15px 15px 15px;
|
||||
margin: 0;
|
||||
min-height: 120px;
|
||||
max-height: 290px;
|
||||
}
|
||||
|
||||
|
||||
2
wp-admin/css/customize-nav-menus.min.css
vendored
2
wp-admin/css/customize-nav-menus.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -247,6 +247,19 @@ textarea[readonly] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Adjust error indicator for password layout */
|
||||
.form-table .form-required.user-pass1-wrap.form-invalid td:after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after {
|
||||
content: '\f534';
|
||||
font: normal 20px/1 dashicons;
|
||||
color: #dc3232;
|
||||
margin: 0 -29px 0 6px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.form-input-tip {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@@ -247,6 +247,19 @@ textarea[readonly] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Adjust error indicator for password layout */
|
||||
.form-table .form-required.user-pass1-wrap.form-invalid td:after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
.form-table .form-required.user-pass1-wrap.form-invalid .password-input-wrapper:after {
|
||||
content: '\f534';
|
||||
font: normal 20px/1 dashicons;
|
||||
color: #dc3232;
|
||||
margin: 0 6px 0 -29px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.form-input-tip {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
@@ -1820,7 +1820,8 @@ div.action-links,
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#comments-form .fixed .column-author {
|
||||
#comments-form .fixed .column-author,
|
||||
#commentsdiv .fixed .column-author {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -1974,6 +1975,22 @@ div.action-links,
|
||||
margin: 0 0 0 6px;
|
||||
}
|
||||
|
||||
#edithead .inside,
|
||||
#commentsdiv #edithead .inside {
|
||||
float: none;
|
||||
text-align: right;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
#commentsdiv #edithead .inside input,
|
||||
#edithead .inside input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#edithead label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#bulk-titles div {
|
||||
margin: 0.8em 0.3em;
|
||||
}
|
||||
|
||||
@@ -1820,7 +1820,8 @@ div.action-links,
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#comments-form .fixed .column-author {
|
||||
#comments-form .fixed .column-author,
|
||||
#commentsdiv .fixed .column-author {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -1974,6 +1975,22 @@ div.action-links,
|
||||
margin: 0 6px 0 0;
|
||||
}
|
||||
|
||||
#edithead .inside,
|
||||
#commentsdiv #edithead .inside {
|
||||
float: none;
|
||||
text-align: left;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
#commentsdiv #edithead .inside input,
|
||||
#edithead .inside input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#edithead label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#bulk-titles div {
|
||||
margin: 0.8em 0.3em;
|
||||
}
|
||||
|
||||
2
wp-admin/css/login-rtl.min.css
vendored
2
wp-admin/css/login-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login.min.css
vendored
2
wp-admin/css/login.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin-rtl.min.css
vendored
2
wp-admin/css/wp-admin-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin.min.css
vendored
2
wp-admin/css/wp-admin.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -18,9 +18,11 @@ if ( ! current_user_can( 'customize' ) ) {
|
||||
|
||||
wp_reset_vars( array( 'url', 'return' ) );
|
||||
$url = wp_unslash( $url );
|
||||
$url = esc_url_raw( $url );
|
||||
$url = wp_validate_redirect( $url, home_url( '/' ) );
|
||||
if ( $return ) {
|
||||
$return = wp_unslash( $return );
|
||||
$return = esc_url_raw( $return );
|
||||
$return = wp_validate_redirect( $return );
|
||||
}
|
||||
if ( ! $return ) {
|
||||
@@ -142,7 +144,7 @@ do_action( 'customize_controls_print_scripts' );
|
||||
<div id="customize-info" class="accordion-section customize-info">
|
||||
<div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Customizer Options' ); ?>">
|
||||
<span class="preview-notice"><?php
|
||||
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name' ) . '</strong>' );
|
||||
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
|
||||
?></span>
|
||||
<button class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
|
||||
</div>
|
||||
|
||||
@@ -2651,7 +2651,7 @@ function wp_ajax_get_revision_diffs() {
|
||||
if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
|
||||
wp_send_json_error();
|
||||
|
||||
if ( ! current_user_can( 'read_post', $post->ID ) )
|
||||
if ( ! current_user_can( 'edit_post', $post->ID ) )
|
||||
wp_send_json_error();
|
||||
|
||||
// Really just pre-loading the cache here.
|
||||
|
||||
@@ -383,8 +383,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
* @return bool
|
||||
*/
|
||||
public function is_writable($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return is_writable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
// PHP will base it's writable checks on system_user === file_owner, not ssh_user === file_owner
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* @param string $file
|
||||
|
||||
@@ -361,7 +361,7 @@ class WP_Media_List_Table extends WP_List_Table {
|
||||
<?php echo $link_end; ?>
|
||||
<?php _media_states( $post ); ?>
|
||||
</strong>
|
||||
<p class="filename"><span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span><?php echo wp_basename( $post->guid ); ?></p>
|
||||
<p class="filename"><span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span><?php echo esc_html( wp_basename( $post->guid ) ); ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
||||
* @param WP_User $user The current WP_User object.
|
||||
*/
|
||||
public function column_email( $user ) {
|
||||
echo "<a href='mailto:$user->user_email'>$user->user_email</a>";
|
||||
echo "<a href='" . esc_url( "mailto:$user->user_email" ) . "'>$user->user_email</a>";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -790,7 +790,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) {
|
||||
the_excerpt();
|
||||
echo esc_html( get_the_excerpt() );
|
||||
}
|
||||
|
||||
get_inline_data( $post );
|
||||
|
||||
@@ -119,10 +119,28 @@ class WP_Press_This {
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'draft',
|
||||
'post_format' => ( ! empty( $_POST['post_format'] ) ) ? sanitize_text_field( $_POST['post_format'] ) : '',
|
||||
'tax_input' => ( ! empty( $_POST['tax_input'] ) ) ? $_POST['tax_input'] : array(),
|
||||
'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(),
|
||||
);
|
||||
|
||||
// Only accept categories if the user actually can assign
|
||||
$category_tax = get_taxonomy( 'category' );
|
||||
if ( current_user_can( $category_tax->cap->assign_terms ) ) {
|
||||
$post_data['post_category'] = ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array();
|
||||
}
|
||||
|
||||
// Only accept taxonomies if the user can actually assign
|
||||
if ( ! empty( $_POST['tax_input'] ) ) {
|
||||
$tax_input = $_POST['tax_input'];
|
||||
foreach ( $tax_input as $tax => $_ti ) {
|
||||
$tax_object = get_taxonomy( $tax );
|
||||
if ( ! $tax_object || ! current_user_can( $tax_object->cap->assign_terms ) ) {
|
||||
unset( $tax_input[ $tax ] );
|
||||
}
|
||||
}
|
||||
|
||||
$post_data['tax_input'] = $tax_input;
|
||||
}
|
||||
|
||||
// Toggle status to pending if user cannot actually publish
|
||||
if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) {
|
||||
if ( current_user_can( 'publish_posts' ) ) {
|
||||
$post['post_status'] = 'publish';
|
||||
@@ -444,7 +462,7 @@ class WP_Press_This {
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param string $src Embed source URL.
|
||||
* @return string If not from a supported provider, an empty string. Otherwise, a reformattd embed URL.
|
||||
* @return string If not from a supported provider, an empty string. Otherwise, a reformatted embed URL.
|
||||
*/
|
||||
private function _limit_embed( $src ) {
|
||||
$src = $this->_limit_url( $src );
|
||||
@@ -692,7 +710,11 @@ class WP_Press_This {
|
||||
* making PT fully backward compatible with the older bookmarklet.
|
||||
*/
|
||||
if ( empty( $_POST ) && ! empty( $data['u'] ) ) {
|
||||
$data = $this->source_data_fetch_fallback( $data['u'], $data );
|
||||
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'scan-site' ) ) {
|
||||
$data = $this->source_data_fetch_fallback( $data['u'], $data );
|
||||
} else {
|
||||
$data['errors'] = 'missing nonce';
|
||||
}
|
||||
} else {
|
||||
foreach ( array( '_images', '_embeds' ) as $type ) {
|
||||
if ( empty( $_POST[ $type ] ) ) {
|
||||
@@ -874,6 +896,12 @@ class WP_Press_This {
|
||||
public function categories_html( $post ) {
|
||||
$taxonomy = get_taxonomy( 'category' );
|
||||
|
||||
// Bail if user cannot assign terms
|
||||
if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only show "add" if user can edit terms
|
||||
if ( current_user_can( $taxonomy->cap->edit_terms ) ) {
|
||||
?>
|
||||
<button type="button" class="add-cat-toggle button-subtle" aria-expanded="false">
|
||||
@@ -1226,7 +1254,7 @@ class WP_Press_This {
|
||||
$site_data = array(
|
||||
'v' => ! empty( $data['v'] ) ? $data['v'] : '',
|
||||
'u' => ! empty( $data['u'] ) ? $data['u'] : '',
|
||||
'hasData' => ! empty( $data ),
|
||||
'hasData' => ! empty( $data ) && ! isset( $data['errors'] ),
|
||||
);
|
||||
|
||||
if ( ! empty( $images ) ) {
|
||||
@@ -1287,6 +1315,12 @@ class WP_Press_This {
|
||||
wp_enqueue_script( 'json2' );
|
||||
wp_enqueue_script( 'editor' );
|
||||
|
||||
$categories_tax = get_taxonomy( 'category' );
|
||||
$show_categories = current_user_can( $categories_tax->cap->assign_terms ) || current_user_can( $categories_tax->cap->edit_terms );
|
||||
|
||||
$tag_tax = get_taxonomy( 'post_tag' );
|
||||
$show_tags = current_user_can( $tag_tax->cap->assign_terms );
|
||||
|
||||
$supports_formats = false;
|
||||
$post_format = 0;
|
||||
|
||||
@@ -1352,8 +1386,9 @@ class WP_Press_This {
|
||||
<div id="scanbar" class="scan">
|
||||
<form method="GET">
|
||||
<label for="url-scan" class="screen-reader-text"><?php _e( 'Scan site for content' ); ?></label>
|
||||
<input type="url" name="u" id="url-scan" class="scan-url" value="" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
|
||||
<input type="url" name="u" id="url-scan" class="scan-url" value="<?php echo esc_attr( $site_data['u'] ) ?>" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
|
||||
<input type="submit" name="url-scan-submit" id="url-scan-submit" class="scan-submit" value="<?php esc_attr_e( 'Scan' ) ?>" />
|
||||
<?php wp_nonce_field( 'scan-site' ); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1438,17 +1473,21 @@ class WP_Press_This {
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-category"></span>
|
||||
<span class="post-option-title"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php if ( $show_categories ) : ?>
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-category"></span>
|
||||
<span class="post-option-title"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-tag"></span>
|
||||
<span class="post-option-title"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php if ( $show_tags ) : ?>
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-tag"></span>
|
||||
<span class="post-option-title"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $supports_formats ) : ?>
|
||||
@@ -1462,23 +1501,27 @@ class WP_Press_This {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="setting-modal is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->categories_html( $post ); ?>
|
||||
</div>
|
||||
<?php if ( $show_categories ) : ?>
|
||||
<div class="setting-modal is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->categories_html( $post ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="setting-modal tags is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->tags_html( $post ); ?>
|
||||
</div>
|
||||
<?php if ( $show_tags ) : ?>
|
||||
<div class="setting-modal tags is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->tags_html( $post ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .options-panel -->
|
||||
</div><!-- .wrapper -->
|
||||
|
||||
|
||||
@@ -2464,8 +2464,12 @@ class File_Upload_Upgrader {
|
||||
if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
|
||||
wp_die( $uploads['error'] );
|
||||
|
||||
$this->filename = $_GET[$urlholder];
|
||||
$this->filename = sanitize_file_name( $_GET[ $urlholder ] );
|
||||
$this->package = $uploads['basedir'] . '/' . $this->filename;
|
||||
|
||||
if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {
|
||||
wp_die( __( 'Please select a file' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ class WP_Users_List_Table extends WP_List_Table {
|
||||
$r .= "$user_object->first_name $user_object->last_name";
|
||||
break;
|
||||
case 'email':
|
||||
$r .= "<a href='mailto:$email'>$email</a>";
|
||||
$r .= "<a href='" . esc_url( "mailto:$email" ) . "'>$email</a>";
|
||||
break;
|
||||
case 'role':
|
||||
$r .= $role_name;
|
||||
|
||||
@@ -1040,14 +1040,28 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
|
||||
$credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => ''));
|
||||
|
||||
$submitted_form = wp_unslash( $_POST );
|
||||
|
||||
// Verify nonce, or unset submitted form field values on failure
|
||||
if ( ! isset( $_POST['_fs_nonce'] ) || ! wp_verify_nonce( $_POST['_fs_nonce'], 'filesystem-credentials' ) ) {
|
||||
unset(
|
||||
$submitted_form['hostname'],
|
||||
$submitted_form['username'],
|
||||
$submitted_form['password'],
|
||||
$submitted_form['public_key'],
|
||||
$submitted_form['private_key'],
|
||||
$submitted_form['connection_type']
|
||||
);
|
||||
}
|
||||
|
||||
// If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
|
||||
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? wp_unslash( $_POST['hostname'] ) : $credentials['hostname']);
|
||||
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? wp_unslash( $_POST['username'] ) : $credentials['username']);
|
||||
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? wp_unslash( $_POST['password'] ) : '');
|
||||
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($submitted_form['hostname']) ? $submitted_form['hostname'] : $credentials['hostname']);
|
||||
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($submitted_form['username']) ? $submitted_form['username'] : $credentials['username']);
|
||||
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($submitted_form['password']) ? $submitted_form['password'] : '');
|
||||
|
||||
// Check to see if we are setting the public/private keys for ssh
|
||||
$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? wp_unslash( $_POST['public_key'] ) : '');
|
||||
$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? wp_unslash( $_POST['private_key'] ) : '');
|
||||
$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($submitted_form['public_key']) ? $submitted_form['public_key'] : '');
|
||||
$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($submitted_form['private_key']) ? $submitted_form['private_key'] : '');
|
||||
|
||||
// Sanitize the hostname, Some people might pass in odd-data:
|
||||
$credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off
|
||||
@@ -1064,8 +1078,8 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
$credentials['connection_type'] = 'ssh';
|
||||
} elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { //Only the FTP Extension understands SSL
|
||||
$credentials['connection_type'] = 'ftps';
|
||||
} elseif ( ! empty( $_POST['connection_type'] ) ) {
|
||||
$credentials['connection_type'] = wp_unslash( $_POST['connection_type'] );
|
||||
} elseif ( ! empty( $submitted_form['connection_type'] ) ) {
|
||||
$credentials['connection_type'] = $submitted_form['connection_type'];
|
||||
} elseif ( ! isset( $credentials['connection_type'] ) ) { //All else fails (And it's not defaulted to something else saved), Default to FTP
|
||||
$credentials['connection_type'] = 'ftp';
|
||||
}
|
||||
@@ -1198,11 +1212,12 @@ jQuery(function($){
|
||||
</fieldset>
|
||||
<?php
|
||||
foreach ( (array) $extra_fields as $field ) {
|
||||
if ( isset( $_POST[ $field ] ) )
|
||||
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( wp_unslash( $_POST[ $field ] ) ) . '" />';
|
||||
if ( isset( $submitted_form[ $field ] ) )
|
||||
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />';
|
||||
}
|
||||
?>
|
||||
<p class="request-filesystem-credentials-action-buttons">
|
||||
<?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>
|
||||
<button class="button cancel-button" data-js-action="close" type="button"><?php _e( 'Cancel' ); ?></button>
|
||||
<?php submit_button( __( 'Proceed' ), 'button', 'upgrade', false ); ?>
|
||||
</p>
|
||||
|
||||
@@ -280,7 +280,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||
$url = $file['url'];
|
||||
$type = $file['type'];
|
||||
$file = $file['file'];
|
||||
$title = $name;
|
||||
$title = sanitize_text_field( $name );
|
||||
$content = '';
|
||||
$excerpt = '';
|
||||
|
||||
@@ -2923,7 +2923,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
|
||||
if ( ! empty( $data[$version]['comments'] ) ) {
|
||||
foreach ( $data[$version]['comments'] as $key => $list ) {
|
||||
if ( 'length' !== $key && ! empty( $list ) ) {
|
||||
$metadata[$key] = reset( $list );
|
||||
$metadata[$key] = wp_kses_post( reset( $list ) );
|
||||
// Fix bug in byte stream analysis.
|
||||
if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
|
||||
$metadata[$key] = 'Cop' . $metadata[$key];
|
||||
|
||||
@@ -165,6 +165,13 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_category'] ) ) {
|
||||
$category_object = get_taxonomy( 'category' );
|
||||
if ( ! current_user_can( $category_object->cap->assign_terms ) ) {
|
||||
unset( $post_data['post_category'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $post_data;
|
||||
}
|
||||
|
||||
@@ -1306,15 +1313,15 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . esc_html( $post_name_abridged ) . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
|
||||
$pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post_name, urldecode( $permalink ) );
|
||||
|
||||
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
|
||||
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
|
||||
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
|
||||
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __( 'Edit' ) . "</a></span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
|
||||
}
|
||||
|
||||
if ( isset( $view_post ) ) {
|
||||
@@ -1328,7 +1335,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
$pretty_permalink = $permalink;
|
||||
}
|
||||
|
||||
$return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
|
||||
$return .= "<span id='view-post-btn'><a href='" . esc_url( $pretty_permalink ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1004,7 +1004,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 = '<div class="editor-expand hidden"><label for="editor-expand-toggle">';
|
||||
|
||||
@@ -478,7 +478,7 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
|
||||
?>
|
||||
<form method="get">
|
||||
<?php if ( $table_row ) : ?>
|
||||
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
|
||||
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
|
||||
<?php else : ?>
|
||||
<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -222,6 +222,7 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
|
||||
'post_date_gmt' => $now_gmt,
|
||||
'post_content' => $first_page,
|
||||
'post_excerpt' => '',
|
||||
'comment_status' => 'closed',
|
||||
'post_title' => __( 'Sample Page' ),
|
||||
/* translators: Default page slug */
|
||||
'post_name' => __( 'sample-page' ),
|
||||
@@ -534,6 +535,9 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 33055 )
|
||||
upgrade_430();
|
||||
|
||||
if ( $wp_current_db_version < 33056 )
|
||||
upgrade_431();
|
||||
|
||||
maybe_disable_link_manager();
|
||||
|
||||
maybe_disable_automattic_widgets();
|
||||
@@ -1577,6 +1581,20 @@ function upgrade_430_fix_comments() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes changes made in WordPress 4.3.1.
|
||||
*
|
||||
* @since 4.3.1
|
||||
*/
|
||||
function upgrade_431() {
|
||||
// Fix incorrect cron entries for term splitting
|
||||
$cron_array = _get_cron_array();
|
||||
if ( isset( $cron_array['wp_batch_split_terms'] ) ) {
|
||||
unset( $cron_array['wp_batch_split_terms'] );
|
||||
_set_cron_array( $cron_array );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes network-level upgrade routines.
|
||||
*
|
||||
@@ -2044,6 +2062,9 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
*/
|
||||
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
|
||||
|
||||
$text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );
|
||||
$blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );
|
||||
|
||||
$global_tables = $wpdb->tables( 'global' );
|
||||
foreach ( $cqueries as $table => $qry ) {
|
||||
// Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.
|
||||
@@ -2113,9 +2134,24 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
|
||||
// Is actual field type different from the field type in query?
|
||||
if ($tablefield->Type != $fieldtype) {
|
||||
$do_change = true;
|
||||
if ( in_array( strtolower( $fieldtype ), $text_fields ) && in_array( strtolower( $tablefield->Type ), $text_fields ) ) {
|
||||
if ( array_search( strtolower( $fieldtype ), $text_fields ) < array_search( strtolower( $tablefield->Type ), $text_fields ) ) {
|
||||
$do_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( in_array( strtolower( $fieldtype ), $blob_fields ) && in_array( strtolower( $tablefield->Type ), $blob_fields ) ) {
|
||||
if ( array_search( strtolower( $fieldtype ), $blob_fields ) < array_search( strtolower( $tablefield->Type ), $blob_fields ) ) {
|
||||
$do_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $do_change ) {
|
||||
// Add a query to change the column type
|
||||
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
|
||||
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
|
||||
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
|
||||
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
|
||||
}
|
||||
}
|
||||
|
||||
// Get the default value from the array
|
||||
|
||||
@@ -176,7 +176,7 @@ function edit_user( $user_id = 0 ) {
|
||||
$user_id = wp_update_user( $user );
|
||||
} else {
|
||||
$user_id = wp_insert_user( $user );
|
||||
wp_new_user_notification( $user_id, 'both' );
|
||||
wp_new_user_notification( $user_id, null, 'both' );
|
||||
}
|
||||
return $user_id;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,10 @@
|
||||
params = params || {};
|
||||
focus = function () {
|
||||
var focusContainer;
|
||||
if ( construct.expanded && construct.expanded() ) {
|
||||
focusContainer = construct.container.find( 'ul:first' );
|
||||
if ( construct.extended( api.Panel ) && construct.expanded && construct.expanded() ) {
|
||||
focusContainer = construct.container.find( 'ul.control-panel-content' );
|
||||
} else if ( construct.extended( api.Section ) && construct.expanded && construct.expanded() ) {
|
||||
focusContainer = construct.container.find( 'ul.accordion-section-content' );
|
||||
} else {
|
||||
focusContainer = construct.container;
|
||||
}
|
||||
@@ -284,8 +286,15 @@
|
||||
* @param {Object} args.duration
|
||||
* @param {Object} args.completeCallback
|
||||
*/
|
||||
onChangeActive: function ( active, args ) {
|
||||
onChangeActive: function( active, args ) {
|
||||
var duration, construct = this;
|
||||
if ( args.unchanged ) {
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
|
||||
if ( ! $.contains( document, construct.container[0] ) ) {
|
||||
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
|
||||
@@ -648,6 +657,9 @@
|
||||
completeCallback: expand
|
||||
});
|
||||
} else {
|
||||
api.panel.each( function( panel ) {
|
||||
panel.collapse();
|
||||
});
|
||||
expand();
|
||||
}
|
||||
|
||||
@@ -1257,7 +1269,7 @@
|
||||
|
||||
// Collapse any sibling sections/panels
|
||||
api.section.each( function ( section ) {
|
||||
if ( ! section.panel() ) {
|
||||
if ( panel.id !== section.panel() ) {
|
||||
section.collapse( { duration: 0 } );
|
||||
}
|
||||
});
|
||||
@@ -1497,6 +1509,13 @@
|
||||
* @param {Callback} args.completeCallback
|
||||
*/
|
||||
onChangeActive: function ( active, args ) {
|
||||
if ( args.unchanged ) {
|
||||
if ( args.completeCallback ) {
|
||||
args.completeCallback();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! $.contains( document, this.container ) ) {
|
||||
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
|
||||
this.container.toggle( active );
|
||||
@@ -2144,14 +2163,20 @@
|
||||
* @param {object} attachment
|
||||
*/
|
||||
setImageFromAttachment: function( attachment ) {
|
||||
var icon = typeof attachment.sizes['site_icon-32'] !== 'undefined' ? attachment.sizes['site_icon-32'] : attachment.sizes.thumbnail;
|
||||
var sizes = [ 'site_icon-32', 'thumbnail', 'full' ],
|
||||
icon;
|
||||
|
||||
_.each( sizes, function( size ) {
|
||||
if ( ! icon && ! _.isUndefined ( attachment.sizes[ size ] ) ) {
|
||||
icon = attachment.sizes[ size ];
|
||||
}
|
||||
} );
|
||||
|
||||
this.params.attachment = attachment;
|
||||
|
||||
// Set the Customizer setting; the callback takes care of rendering.
|
||||
this.setting( attachment.id );
|
||||
|
||||
|
||||
// Update the icon in-browser.
|
||||
$( 'link[sizes="32x32"]' ).attr( 'href', icon.url );
|
||||
},
|
||||
@@ -3202,6 +3227,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Ensure preview nonce is included with every customized request, to allow post data to be read.
|
||||
$.ajaxPrefilter( function injectPreviewNonce( options ) {
|
||||
if ( ! /wp_customize=on/.test( options.data ) ) {
|
||||
return;
|
||||
}
|
||||
options.data += '&' + $.param({
|
||||
customize_preview_nonce: api.settings.nonce.preview
|
||||
});
|
||||
});
|
||||
|
||||
// Refresh the nonces if the preview sends updated nonces over.
|
||||
api.previewer.bind( 'nonce', function( nonce ) {
|
||||
$.extend( this.nonce, nonce );
|
||||
|
||||
4
wp-admin/js/customize-controls.min.js
vendored
4
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -119,6 +119,10 @@
|
||||
initialize: function() {
|
||||
var self = this;
|
||||
|
||||
if ( ! api.panel.has( 'nav_menus' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.$search = $( '#menu-items-search' );
|
||||
this.sectionContent = this.$el.find( '.accordion-section-content' );
|
||||
|
||||
@@ -1128,7 +1132,11 @@
|
||||
}
|
||||
});
|
||||
if ( settingValue ) {
|
||||
element.set( settingValue[ property ] );
|
||||
if ( ( property === 'classes' || property === 'xfn' ) && _.isArray( settingValue[ property ] ) ) {
|
||||
element.set( settingValue[ property ].join( ' ' ) );
|
||||
} else {
|
||||
element.set( settingValue[ property ] );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1863,6 +1871,9 @@
|
||||
|
||||
control.isSorting = false;
|
||||
|
||||
// Reset horizontal scroll position when done dragging.
|
||||
control.$sectionContent.scrollLeft( 0 );
|
||||
|
||||
_.each( menuItemContainerIds, function( menuItemContainerId ) {
|
||||
var menuItemId, menuItemControl, matches;
|
||||
matches = menuItemContainerId.match( /^customize-control-nav_menu_item-(-?\d+)$/, '' );
|
||||
|
||||
4
wp-admin/js/customize-nav-menus.min.js
vendored
4
wp-admin/js/customize-nav-menus.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -362,7 +362,8 @@ commentReply = {
|
||||
var editRow, rowData, act, replyButton, editHeight,
|
||||
t = this,
|
||||
c = $('#comment-' + comment_id),
|
||||
h = c.height();
|
||||
h = c.height(),
|
||||
colspanVal = 0;
|
||||
|
||||
t.close();
|
||||
t.cid = comment_id;
|
||||
@@ -372,6 +373,12 @@ commentReply = {
|
||||
action = action || 'replyto';
|
||||
act = 'edit' == action ? 'edit' : 'replyto';
|
||||
act = t.act = act + '-comment';
|
||||
colspanVal = $( 'th:visible, td:visible', c ).length;
|
||||
|
||||
// Make sure it's actually a table and there's a `colspan` value to apply.
|
||||
if ( editRow.hasClass( 'inline-edit-row' ) && 0 !== colspanVal ) {
|
||||
$( 'td', editRow ).attr( 'colspan', colspanVal );
|
||||
}
|
||||
|
||||
$('#action', editRow).val(act);
|
||||
$('#comment_post_ID', editRow).val(post_id);
|
||||
|
||||
2
wp-admin/js/edit-comments.min.js
vendored
2
wp-admin/js/edit-comments.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -46,9 +46,10 @@ window.wp = window.wp || {};
|
||||
connectionType: null
|
||||
},
|
||||
ssh: {
|
||||
publicKey: null,
|
||||
privateKey: null
|
||||
}
|
||||
publicKey: '',
|
||||
privateKey: ''
|
||||
},
|
||||
fsNonce: ''
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -180,6 +181,7 @@ window.wp = window.wp || {};
|
||||
_ajax_nonce: wp.updates.ajaxNonce,
|
||||
plugin: plugin,
|
||||
slug: slug,
|
||||
_fs_nonce: wp.updates.filesystemCredentials.fsNonce,
|
||||
username: wp.updates.filesystemCredentials.ftp.username,
|
||||
password: wp.updates.filesystemCredentials.ftp.password,
|
||||
hostname: wp.updates.filesystemCredentials.ftp.hostname,
|
||||
@@ -454,6 +456,7 @@ window.wp = window.wp || {};
|
||||
// File system credentials form submit noop-er / handler.
|
||||
$( '#request-filesystem-credentials-dialog form' ).on( 'submit', function() {
|
||||
// Persist the credentials input by the user for the duration of the page load.
|
||||
wp.updates.filesystemCredentials.fsNonce = $( '#_fs_nonce' ).val();
|
||||
wp.updates.filesystemCredentials.ftp.hostname = $('#hostname').val();
|
||||
wp.updates.filesystemCredentials.ftp.username = $('#username').val();
|
||||
wp.updates.filesystemCredentials.ftp.password = $('#password').val();
|
||||
|
||||
2
wp-admin/js/updates.min.js
vendored
2
wp-admin/js/updates.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -6,23 +6,33 @@
|
||||
$pass1Wrap,
|
||||
$pass1,
|
||||
$pass1Text,
|
||||
|
||||
$pass1Label,
|
||||
$pass2,
|
||||
|
||||
$weakRow,
|
||||
$weakCheckbox,
|
||||
|
||||
$toggleButton,
|
||||
$submitButtons,
|
||||
$submitButton,
|
||||
currentPass;
|
||||
currentPass,
|
||||
inputEvent;
|
||||
|
||||
/*
|
||||
* Use feature detection to determine whether password inputs should use
|
||||
* the `keyup` or `input` event. Input is preferred but lacks support
|
||||
* in legacy browsers.
|
||||
*/
|
||||
if ( 'oninput' in document.createElement( 'input' ) ) {
|
||||
inputEvent = 'input';
|
||||
} else {
|
||||
inputEvent = 'keyup';
|
||||
}
|
||||
|
||||
function generatePassword() {
|
||||
if ( typeof zxcvbn !== 'function' ) {
|
||||
setTimeout( generatePassword, 50 );
|
||||
} else {
|
||||
$pass1.val( $pass1.data( 'pw' ) );
|
||||
$pass1.trigger( 'pwupdate' );
|
||||
$pass1.trigger( 'pwupdate' ).trigger( 'wp-check-valid-field' );
|
||||
if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) {
|
||||
$pass1Wrap.addClass( 'show-password' );
|
||||
} else {
|
||||
@@ -47,7 +57,7 @@
|
||||
.addClass( $pass1[0].className )
|
||||
.data( 'pw', $pass1.data( 'pw' ) )
|
||||
.val( $pass1.val() )
|
||||
.on( 'keyup', function () {
|
||||
.on( inputEvent, function () {
|
||||
if ( $pass1Text.val() === currentPass ) {
|
||||
return;
|
||||
}
|
||||
@@ -62,7 +72,7 @@
|
||||
generatePassword();
|
||||
}
|
||||
|
||||
$pass1.on( 'keyup pwupdate', function () {
|
||||
$pass1.on( inputEvent + ' pwupdate', function () {
|
||||
if ( $pass1.val() === currentPass ) {
|
||||
return;
|
||||
}
|
||||
@@ -107,6 +117,8 @@
|
||||
|
||||
$pass1Text.focus();
|
||||
|
||||
$pass1Label.attr( 'for', 'pass1-text' );
|
||||
|
||||
if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) {
|
||||
$pass1Text[0].setSelectionRange( 0, 100 );
|
||||
}
|
||||
@@ -126,6 +138,8 @@
|
||||
|
||||
$pass1.focus();
|
||||
|
||||
$pass1Label.attr( 'for', 'pass1' );
|
||||
|
||||
if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) {
|
||||
$pass1[0].setSelectionRange( 0, 100 );
|
||||
}
|
||||
@@ -139,6 +153,8 @@
|
||||
$cancelButton;
|
||||
|
||||
$pass1Row = $('.user-pass1-wrap');
|
||||
$pass1Label = $pass1Row.find('th label').attr( 'for', 'pass1-text' );
|
||||
|
||||
// hide this
|
||||
$('.user-pass2-wrap').hide();
|
||||
|
||||
@@ -165,7 +181,7 @@
|
||||
* This fixes the issue by copying any changes from the hidden
|
||||
* pass2 field to the pass1 field, then running check_pass_strength.
|
||||
*/
|
||||
$pass2 = $('#pass2').on( 'keyup', function () {
|
||||
$pass2 = $('#pass2').on( inputEvent, function () {
|
||||
if ( $pass2.val().length > 0 ) {
|
||||
$pass1.val( $pass2.val() );
|
||||
$pass2.val('');
|
||||
@@ -203,6 +219,10 @@
|
||||
|
||||
$generateButton.show();
|
||||
$passwordWrapper.hide();
|
||||
|
||||
// Clear password field to prevent update
|
||||
$pass1.val( '' ).trigger( 'pwupdate' );
|
||||
$submitButtons.prop( 'disabled', false );
|
||||
} );
|
||||
|
||||
$pass1Row.closest('form').on( 'submit', function () {
|
||||
@@ -246,7 +266,7 @@
|
||||
var $colorpicker, $stylesheet, user_id, current_user_id,
|
||||
select = $( '#display_name' );
|
||||
|
||||
$('#pass1').val('').on( 'keyup pwupdate', check_pass_strength );
|
||||
$('#pass1').val('').on( inputEvent + ' pwupdate', check_pass_strength );
|
||||
$('#pass-strength-result').show();
|
||||
$('.color-palette').click( function() {
|
||||
$(this).siblings('input[name="admin_color"]').prop('checked', true);
|
||||
|
||||
2
wp-admin/js/user-profile.min.js
vendored
2
wp-admin/js/user-profile.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -273,7 +273,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
|
||||
<td>
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo get_site_option('first_comment_author') ?>" />
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo esc_attr( get_site_option('first_comment_author') ); ?>" />
|
||||
<p class="description" id="first-comment-author-desc">
|
||||
<?php _e( 'The author of the first comment on a new site.' ) ?>
|
||||
</p>
|
||||
|
||||
@@ -79,7 +79,7 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
|
||||
if ( false === $user_id )
|
||||
wp_die( __( 'There was an error creating the user.' ) );
|
||||
else
|
||||
wp_new_user_notification( $user_id, 'both' );
|
||||
wp_new_user_notification( $user_id, null, 'both' );
|
||||
}
|
||||
|
||||
$wpdb->hide_errors();
|
||||
|
||||
@@ -77,7 +77,7 @@ if ( $action ) {
|
||||
if ( false === $user_id ) {
|
||||
$update = 'err_new_dup';
|
||||
} else {
|
||||
wp_new_user_notification( $user_id, 'both' );
|
||||
wp_new_user_notification( $user_id, null, 'both' );
|
||||
add_user_to_blog( $id, $user_id, $_POST['new_role'] );
|
||||
$update = 'newuser';
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
|
||||
if ( ! $user_id ) {
|
||||
$add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
|
||||
} else {
|
||||
wp_new_user_notification( $user_id, 'both' );
|
||||
wp_new_user_notification( $user_id, null, 'both' );
|
||||
wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,8 @@ function confirm_delete_users( $users ) {
|
||||
<li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="delete" checked="checked" />
|
||||
<?php _e( 'Delete all content.' ); ?></label></li>
|
||||
<li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="reassign" />
|
||||
<?php _e( 'Attribute all content to:' ) . "</label>\n" . $user_dropdown; ?></li>
|
||||
<?php _e( 'Attribute all content to:' ); ?></label>
|
||||
<?php echo $user_dropdown; ?></li>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -231,6 +231,14 @@ if ( $action ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail on all if any paths are invalid.
|
||||
// validate_file() returns truthy for invalid files
|
||||
$invalid_plugin_files = array_filter( $plugins, 'validate_file' );
|
||||
if ( $invalid_plugin_files ) {
|
||||
wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
|
||||
exit;
|
||||
}
|
||||
|
||||
include(ABSPATH . 'wp-admin/update.php');
|
||||
|
||||
$parent_file = 'plugins.php';
|
||||
|
||||
@@ -63,7 +63,7 @@ default :
|
||||
if ( ! $post = get_post( $revision->post_parent ) )
|
||||
break;
|
||||
|
||||
if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'read_post', $post->ID ) )
|
||||
if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) )
|
||||
break;
|
||||
|
||||
// Revisions disabled and we're not looking at an autosave
|
||||
|
||||
@@ -253,6 +253,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 );
|
||||
|
||||
$info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
|
||||
if ( is_wp_error( $info ) ) {
|
||||
$info = false;
|
||||
|
||||
@@ -99,7 +99,7 @@ if ( is_multisite()
|
||||
// Execute confirmed email change. See send_confirmation_on_profile_email().
|
||||
if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
|
||||
$new_email = get_option( $current_user->ID . '_new_email' );
|
||||
if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
|
||||
if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) {
|
||||
$user = new stdClass;
|
||||
$user->ID = $current_user->ID;
|
||||
$user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) );
|
||||
@@ -110,7 +110,8 @@ if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $c
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
}
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) {
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
|
||||
check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
|
||||
delete_option( $current_user->ID . '_new_email' );
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
@@ -405,8 +406,8 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
|
||||
<p><?php
|
||||
printf(
|
||||
__( 'There is a pending change of your e-mail to %1$s. <a href="%2$s">Cancel</a>' ),
|
||||
'<code>' . $new_email['newemail'] . '</code>',
|
||||
esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) )
|
||||
'<code>' . esc_html( $new_email['newemail'] ) . '</code>',
|
||||
esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) )
|
||||
); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -17,6 +17,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 );
|
||||
}
|
||||
|
||||
@@ -1207,7 +1207,8 @@ class Walker_CategoryDropdown extends Walker {
|
||||
|
||||
$output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . "\"";
|
||||
|
||||
if ( $category->{$value_field} == $args['selected'] )
|
||||
// Type-juggling causes false matches, so we force everything to a string.
|
||||
if ( (string) $category->{$value_field} === (string) $args['selected'] )
|
||||
$output .= ' selected="selected"';
|
||||
$output .= '>';
|
||||
$output .= $pad.$cat_name;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,25 +28,25 @@ class SMTP
|
||||
{
|
||||
/**
|
||||
* The PHPMailer SMTP version number.
|
||||
* @type string
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '5.2.10';
|
||||
const VERSION = '5.2.22';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
* @type string
|
||||
* @var string
|
||||
*/
|
||||
const CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* The SMTP port to use if one is not specified.
|
||||
* @type integer
|
||||
* @var integer
|
||||
*/
|
||||
const DEFAULT_SMTP_PORT = 25;
|
||||
|
||||
/**
|
||||
* The maximum line length allowed by RFC 2822 section 2.1.1
|
||||
* @type integer
|
||||
* @var integer
|
||||
*/
|
||||
const MAX_LINE_LENGTH = 998;
|
||||
|
||||
@@ -77,15 +77,15 @@ class SMTP
|
||||
|
||||
/**
|
||||
* The PHPMailer SMTP Version number.
|
||||
* @type string
|
||||
* @var string
|
||||
* @deprecated Use the `VERSION` constant instead
|
||||
* @see SMTP::VERSION
|
||||
*/
|
||||
public $Version = '5.2.10';
|
||||
public $Version = '5.2.22';
|
||||
|
||||
/**
|
||||
* SMTP server port number.
|
||||
* @type integer
|
||||
* @var integer
|
||||
* @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
|
||||
* @see SMTP::DEFAULT_SMTP_PORT
|
||||
*/
|
||||
@@ -93,7 +93,7 @@ class SMTP
|
||||
|
||||
/**
|
||||
* SMTP reply line ending.
|
||||
* @type string
|
||||
* @var string
|
||||
* @deprecated Use the `CRLF` constant instead
|
||||
* @see SMTP::CRLF
|
||||
*/
|
||||
@@ -107,7 +107,7 @@ class SMTP
|
||||
* * self::DEBUG_SERVER (`2`) Client commands and server responses
|
||||
* * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
|
||||
* * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
|
||||
* @type integer
|
||||
* @var integer
|
||||
*/
|
||||
public $do_debug = self::DEBUG_OFF;
|
||||
|
||||
@@ -122,7 +122,7 @@ class SMTP
|
||||
* <code>
|
||||
* $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
|
||||
* </code>
|
||||
* @type string|callable
|
||||
* @var string|callable
|
||||
*/
|
||||
public $Debugoutput = 'echo';
|
||||
|
||||
@@ -130,7 +130,7 @@ class SMTP
|
||||
* Whether to use VERP.
|
||||
* @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
|
||||
* @link http://www.postfix.org/VERP_README.html Info on VERP
|
||||
* @type boolean
|
||||
* @var boolean
|
||||
*/
|
||||
public $do_verp = false;
|
||||
|
||||
@@ -139,26 +139,37 @@ class SMTP
|
||||
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
||||
* This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
|
||||
* @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
|
||||
* @type integer
|
||||
* @var integer
|
||||
*/
|
||||
public $Timeout = 300;
|
||||
|
||||
/**
|
||||
* How long to wait for commands to complete, in seconds.
|
||||
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
|
||||
* @type integer
|
||||
* @var integer
|
||||
*/
|
||||
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.
|
||||
* @type resource
|
||||
* @var resource
|
||||
*/
|
||||
protected $smtp_conn;
|
||||
|
||||
/**
|
||||
* Error information, if any, for the last SMTP command.
|
||||
* @type array
|
||||
* @var array
|
||||
*/
|
||||
protected $error = array(
|
||||
'error' => '',
|
||||
@@ -170,7 +181,7 @@ class SMTP
|
||||
/**
|
||||
* The reply the server sent to us for HELO.
|
||||
* If null, no HELO string has yet been received.
|
||||
* @type string|null
|
||||
* @var string|null
|
||||
*/
|
||||
protected $helo_rply = null;
|
||||
|
||||
@@ -181,13 +192,13 @@ class SMTP
|
||||
* represents the server name. In case of HELO it is the only element of the array.
|
||||
* Other values can be boolean TRUE or an array containing extension options.
|
||||
* If null, no HELO/EHLO string has yet been received.
|
||||
* @type array|null
|
||||
* @var array|null
|
||||
*/
|
||||
protected $server_caps = null;
|
||||
|
||||
/**
|
||||
* The most recent reply received from the server.
|
||||
* @type string
|
||||
* @var string
|
||||
*/
|
||||
protected $last_reply = '';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -351,20 +376,21 @@ class SMTP
|
||||
* Perform SMTP authentication.
|
||||
* Must be run after hello().
|
||||
* @see hello()
|
||||
* @param string $username The user name
|
||||
* @param string $password The password
|
||||
* @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5)
|
||||
* @param string $realm The auth realm for NTLM
|
||||
* @param string $username The user name
|
||||
* @param string $password The password
|
||||
* @param string $authtype The auth type (PLAIN, LOGIN, CRAM-MD5)
|
||||
* @param string $realm The auth realm for NTLM
|
||||
* @param string $workstation The auth workstation for NTLM
|
||||
* @access public
|
||||
* @return boolean True if successfully authenticated.
|
||||
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
|
||||
* @return bool True if successfully authenticated.* @access public
|
||||
*/
|
||||
public function authenticate(
|
||||
$username,
|
||||
$password,
|
||||
$authtype = null,
|
||||
$realm = '',
|
||||
$workstation = ''
|
||||
$workstation = '',
|
||||
$OAuth = null
|
||||
) {
|
||||
if (!$this->server_caps) {
|
||||
$this->setError('Authentication is not allowed before HELO/EHLO');
|
||||
@@ -388,7 +414,7 @@ class SMTP
|
||||
);
|
||||
|
||||
if (empty($authtype)) {
|
||||
foreach (array('LOGIN', 'CRAM-MD5', 'PLAIN') as $method) {
|
||||
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN') as $method) {
|
||||
if (in_array($method, $this->server_caps['AUTH'])) {
|
||||
$authtype = $method;
|
||||
break;
|
||||
@@ -672,10 +698,12 @@ class SMTP
|
||||
protected function parseHelloFields($type)
|
||||
{
|
||||
$this->server_caps = array();
|
||||
$lines = explode("\n", $this->last_reply);
|
||||
$lines = explode("\n", $this->helo_rply);
|
||||
|
||||
foreach ($lines as $n => $s) {
|
||||
//First 4 chars contain response code followed by - or space
|
||||
$s = trim(substr($s, 4));
|
||||
if (!$s) {
|
||||
if (empty($s)) {
|
||||
continue;
|
||||
}
|
||||
$fields = explode(' ', $s);
|
||||
@@ -685,11 +713,20 @@ class SMTP
|
||||
$fields = $fields[0];
|
||||
} else {
|
||||
$name = array_shift($fields);
|
||||
if ($name == 'SIZE') {
|
||||
$fields = ($fields) ? $fields[0] : 0;
|
||||
switch ($name) {
|
||||
case 'SIZE':
|
||||
$fields = ($fields ? $fields[0] : 0);
|
||||
break;
|
||||
case 'AUTH':
|
||||
if (!is_array($fields)) {
|
||||
$fields = array();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$fields = true;
|
||||
}
|
||||
}
|
||||
$this->server_caps[$name] = ($fields ? $fields : true);
|
||||
$this->server_caps[$name] = $fields;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -739,15 +776,15 @@ class SMTP
|
||||
* Sets the TO argument to $toaddr.
|
||||
* Returns true if the recipient was accepted false if it was rejected.
|
||||
* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
|
||||
* @param string $toaddr The address the message is being sent to
|
||||
* @param string $address The address the message is being sent to
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
public function recipient($toaddr)
|
||||
public function recipient($address)
|
||||
{
|
||||
return $this->sendCommand(
|
||||
'RCPT TO',
|
||||
'RCPT TO:<' . $toaddr . '>',
|
||||
'RCPT TO:<' . $address . '>',
|
||||
array(250, 251)
|
||||
);
|
||||
}
|
||||
@@ -766,9 +803,9 @@ class SMTP
|
||||
|
||||
/**
|
||||
* Send a command to an SMTP server and check its return code.
|
||||
* @param string $command The command name - not sent to the server
|
||||
* @param string $command The command name - not sent to the server
|
||||
* @param string $commandstring The actual command to send
|
||||
* @param integer|array $expect One or more expected integer success codes
|
||||
* @param integer|array $expect One or more expected integer success codes
|
||||
* @access protected
|
||||
* @return boolean True on success.
|
||||
*/
|
||||
@@ -778,6 +815,11 @@ class SMTP
|
||||
$this->setError("Called $command without being connected");
|
||||
return false;
|
||||
}
|
||||
//Reject line breaks in all commands
|
||||
if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
|
||||
$this->setError("Command '$command' contained line breaks");
|
||||
return false;
|
||||
}
|
||||
$this->client_send($commandstring . self::CRLF);
|
||||
|
||||
$this->last_reply = $this->get_lines();
|
||||
@@ -981,10 +1023,9 @@ class SMTP
|
||||
}
|
||||
while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
|
||||
$str = @fgets($this->smtp_conn, 515);
|
||||
$this->edebug("SMTP -> get_lines(): \$data was \"$data\"", self::DEBUG_LOWLEVEL);
|
||||
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
|
||||
$data .= $str;
|
||||
$this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
|
||||
$this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
|
||||
$data .= $str;
|
||||
// If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
|
||||
if ((isset($str[3]) and $str[3] == ' ')) {
|
||||
break;
|
||||
@@ -1099,4 +1140,47 @@ class SMTP
|
||||
{
|
||||
return $this->Timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports an error number and string.
|
||||
* @param integer $errno The error number returned by PHP.
|
||||
* @param string $errmsg The error message returned by PHP.
|
||||
*/
|
||||
protected function errorHandler($errno, $errmsg)
|
||||
{
|
||||
$notice = 'Connection: Failed to connect to server.';
|
||||
$this->setError(
|
||||
$notice,
|
||||
$errno,
|
||||
$errmsg
|
||||
);
|
||||
$this->edebug(
|
||||
$notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
|
||||
self::DEBUG_CONNECTION
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return the ID of the last smtp transaction based on a list of patterns provided
|
||||
* in SMTP::$smtp_transaction_id_patterns.
|
||||
* If no reply has been received yet, it will return null.
|
||||
* If no pattern has been matched, it will return false.
|
||||
* @return bool|null|string
|
||||
*/
|
||||
public function getLastTransactionID()
|
||||
{
|
||||
$reply = $this->getLastReply();
|
||||
|
||||
if (empty($reply)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
|
||||
if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
|
||||
return $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -999,20 +999,23 @@ class Snoopy
|
||||
if(!empty($this->user) || !empty($this->pass))
|
||||
$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
|
||||
|
||||
for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
|
||||
$safer_header = strtr( $headers[$curr_header], "\"", " " );
|
||||
$cmdline_params .= " -H \"".$safer_header."\"";
|
||||
$headerfile = tempnam( $this->temp_dir, "sno" );
|
||||
$cmdline_params = '-k -D ' . escapeshellarg( $headerfile );
|
||||
|
||||
foreach ( $headers as $header ) {
|
||||
$cmdline_params .= ' -H ' . escapeshellarg( $header );
|
||||
}
|
||||
|
||||
if(!empty($body))
|
||||
$cmdline_params .= " -d \"$body\"";
|
||||
if ( ! empty( $body ) ) {
|
||||
$cmdline_params .= ' -d ' . escapeshellarg( $body );
|
||||
}
|
||||
|
||||
if($this->read_timeout > 0)
|
||||
$cmdline_params .= " -m ".$this->read_timeout;
|
||||
if ( $this->read_timeout > 0 ) {
|
||||
$cmdline_params .= ' -m ' . escapeshellarg( $this->read_timeout );
|
||||
}
|
||||
|
||||
$headerfile = tempnam($this->temp_dir, "sno");
|
||||
|
||||
exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);
|
||||
exec( $this->curl_path . ' ' . $cmdline_params . ' ' . escapeshellarg( $URI ), $results, $return );
|
||||
|
||||
if($return)
|
||||
{
|
||||
|
||||
@@ -223,6 +223,24 @@ final class WP_Customize_Manager {
|
||||
|
||||
show_admin_bar( false );
|
||||
|
||||
/*
|
||||
* Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer
|
||||
* application will inject the customize_preview_nonce query parameter into all Ajax requests.
|
||||
* For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out
|
||||
* a user when a valid nonce isn't present.
|
||||
*/
|
||||
$has_post_data_nonce = (
|
||||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false )
|
||||
||
|
||||
check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false )
|
||||
||
|
||||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false )
|
||||
);
|
||||
if ( ! $has_post_data_nonce ) {
|
||||
unset( $_POST['customized'] );
|
||||
unset( $_REQUEST['customized'] );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'customize' ) ) {
|
||||
$this->wp_die( -1 );
|
||||
}
|
||||
|
||||
@@ -930,7 +930,7 @@ final class WP_Customize_Nav_Menus {
|
||||
'renderQueryVar' => self::RENDER_QUERY_VAR,
|
||||
'renderNonceValue' => wp_create_nonce( self::RENDER_AJAX_ACTION ),
|
||||
'renderNoncePostKey' => self::RENDER_NONCE_POST_KEY,
|
||||
'requestUri' => '/',
|
||||
'requestUri' => empty( $_SERVER['REQUEST_URI'] ) ? home_url( '/' ) : esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
|
||||
'theme' => array(
|
||||
'stylesheet' => $this->manager->get_stylesheet(),
|
||||
'active' => $this->manager->is_theme_active(),
|
||||
@@ -939,10 +939,6 @@ final class WP_Customize_Nav_Menus {
|
||||
'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args,
|
||||
);
|
||||
|
||||
if ( ! empty( $_SERVER['REQUEST_URI'] ) ) {
|
||||
$exports['requestUri'] = esc_url_raw( home_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
}
|
||||
|
||||
printf( '<script>var _wpCustomizePreviewNavMenusExports = %s;</script>', wp_json_encode( $exports ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
|
||||
$this->headers['Name'] = $this->stylesheet;
|
||||
if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), $this->stylesheet ) );
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
|
||||
else
|
||||
$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
|
||||
$this->template = $this->stylesheet;
|
||||
@@ -275,7 +275,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
$theme_root_template = $directories[ $this->template ]['theme_root'];
|
||||
} else {
|
||||
// Parent theme is missing.
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
$this->parent = new WP_Theme( $this->template, $this->theme_root, $this );
|
||||
return;
|
||||
@@ -287,11 +287,11 @@ final class WP_Theme implements ArrayAccess {
|
||||
// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
|
||||
if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
|
||||
$_child->parent = null;
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
|
||||
$_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
|
||||
// The two themes actually reference each other with the Template header.
|
||||
if ( $_child->stylesheet == $this->template ) {
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
}
|
||||
return;
|
||||
@@ -697,8 +697,9 @@ final class WP_Theme implements ArrayAccess {
|
||||
private function markup_header( $header, $value, $translate ) {
|
||||
switch ( $header ) {
|
||||
case 'Name' :
|
||||
if ( empty( $value ) )
|
||||
$value = $this->get_stylesheet();
|
||||
if ( empty( $value ) ) {
|
||||
$value = esc_html( $this->get_stylesheet() );
|
||||
}
|
||||
break;
|
||||
case 'Description' :
|
||||
$value = wptexturize( $value );
|
||||
|
||||
@@ -352,6 +352,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
if ( isset($meta['id']) ) {
|
||||
$meta['id'] = (int) $meta['id'];
|
||||
$pmeta = get_metadata_by_mid( 'post', $meta['id'] );
|
||||
|
||||
if ( ! $pmeta || $pmeta->post_id != $post_id ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset($meta['key']) ) {
|
||||
$meta['key'] = wp_unslash( $meta['key'] );
|
||||
if ( $meta['key'] !== $pmeta->meta_key )
|
||||
@@ -1243,10 +1248,31 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
* @return IXR_Error|string
|
||||
*/
|
||||
protected function _insert_post( $user, $content_struct ) {
|
||||
$defaults = array( 'post_status' => 'draft', 'post_type' => 'post', 'post_author' => 0,
|
||||
'post_password' => '', 'post_excerpt' => '', 'post_content' => '', 'post_title' => '' );
|
||||
$defaults = array(
|
||||
'post_status' => 'draft',
|
||||
'post_type' => 'post',
|
||||
'post_author' => null,
|
||||
'post_password' => null,
|
||||
'post_excerpt' => null,
|
||||
'post_content' => null,
|
||||
'post_title' => null,
|
||||
'post_date' => null,
|
||||
'post_date_gmt' => null,
|
||||
'post_format' => null,
|
||||
'post_name' => null,
|
||||
'post_thumbnail' => null,
|
||||
'post_parent' => null,
|
||||
'ping_status' => null,
|
||||
'comment_status' => null,
|
||||
'custom_fields' => null,
|
||||
'terms_names' => null,
|
||||
'terms' => null,
|
||||
'sticky' => null,
|
||||
'enclosure' => null,
|
||||
'ID' => null,
|
||||
);
|
||||
|
||||
$post_data = wp_parse_args( $content_struct, $defaults );
|
||||
$post_data = wp_parse_args( array_intersect_key( $content_struct, $defaults ), $defaults );
|
||||
|
||||
$post_type = get_post_type_object( $post_data['post_type'] );
|
||||
if ( ! $post_type )
|
||||
@@ -1430,9 +1456,6 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$post_data['tax_input'] = $terms;
|
||||
unset( $post_data['terms'], $post_data['terms_names'] );
|
||||
} else {
|
||||
// Do not allow direct submission of 'tax_input', clients must use 'terms' and/or 'terms_names'.
|
||||
unset( $post_data['tax_input'], $post_data['post_category'], $post_data['tags_input'] );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_format'] ) ) {
|
||||
@@ -5234,8 +5257,8 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
|
||||
|
||||
if ( ('publish' == $post_status) ) {
|
||||
if ( ( 'page' == $post_type ) && ! current_user_can( 'publish_pages' ) ) {
|
||||
if ( 'publish' == $post_status || 'private' == $post_status ) {
|
||||
if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) );
|
||||
} elseif ( ! current_user_can( 'publish_posts' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
|
||||
|
||||
@@ -1574,8 +1574,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
<p class="nav-menu-widget-no-menus-message" <?php if ( ! empty( $menus ) ) { echo ' style="display:none" '; } ?>>
|
||||
<?php
|
||||
if ( isset( $GLOBALS['wp_customize'] ) && $GLOBALS['wp_customize'] instanceof WP_Customize_Manager ) {
|
||||
// @todo When expanding a panel, the JS should be smart enough to collapse any existing panels and sections.
|
||||
$url = 'javascript: wp.customize.section.each(function( section ){ section.collapse(); }); wp.customize.panel( "nav_menus" ).focus();';
|
||||
$url = 'javascript: wp.customize.panel( "nav_menus" ).focus();';
|
||||
} else {
|
||||
$url = admin_url( 'nav-menus.php' );
|
||||
}
|
||||
|
||||
@@ -596,7 +596,9 @@ function wpautop( $pee, $br = true ) {
|
||||
$pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee);
|
||||
|
||||
// Restore newlines in all elements.
|
||||
$pee = str_replace( " <!-- wpnl --> ", "\n", $pee );
|
||||
if ( false !== strpos( $pee, '<!-- wpnl -->' ) ) {
|
||||
$pee = str_replace( array( ' <!-- wpnl --> ', '<!-- wpnl -->' ), "\n", $pee );
|
||||
}
|
||||
|
||||
return $pee;
|
||||
}
|
||||
@@ -1296,7 +1298,8 @@ function remove_accents( $string ) {
|
||||
* operating systems and special characters requiring special escaping
|
||||
* to manipulate at the command line. Replaces spaces and consecutive
|
||||
* dashes with a single dash. Trims period, dash and underscore from beginning
|
||||
* and end of filename.
|
||||
* and end of filename. It is not guaranteed that this function will return a
|
||||
* filename that is allowed to be uploaded.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
@@ -1321,6 +1324,14 @@ function sanitize_file_name( $filename ) {
|
||||
$filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
|
||||
$filename = trim( $filename, '.-_' );
|
||||
|
||||
if ( false === strpos( $filename, '.' ) ) {
|
||||
$mime_types = wp_get_mime_types();
|
||||
$filetype = wp_check_filetype( 'test.' . $filename, $mime_types );
|
||||
if ( $filetype['ext'] === $filename ) {
|
||||
$filename = 'unnamed-file.' . $filetype['ext'];
|
||||
}
|
||||
}
|
||||
|
||||
// Split the filename into a base and extension[s]
|
||||
$parts = explode('.', $filename);
|
||||
|
||||
|
||||
@@ -2081,7 +2081,7 @@ function wp_check_filetype( $filename, $mimes = null ) {
|
||||
* If it's determined that the extension does not match the file's real type,
|
||||
* then the "proper_filename" value will be set with a proper filename and extension.
|
||||
*
|
||||
* Currently this function only supports validating images known to getimagesize().
|
||||
* Currently this function only supports renaming images validated via wp_get_image_mime().
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
@@ -2105,14 +2105,15 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
return compact( 'ext', 'type', 'proper_filename' );
|
||||
}
|
||||
|
||||
// We're able to validate images using GD
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) && function_exists('getimagesize') ) {
|
||||
// Validate image types.
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) ) {
|
||||
|
||||
// Attempt to figure out what type of image it actually is
|
||||
$imgstats = @getimagesize( $file );
|
||||
$real_mime = wp_get_image_mime( $file );
|
||||
|
||||
// If getimagesize() knows what kind of image it really is and if the real MIME doesn't match the claimed MIME
|
||||
if ( !empty($imgstats['mime']) && $imgstats['mime'] != $type ) {
|
||||
if ( ! $real_mime ) {
|
||||
$type = $ext = false;
|
||||
} elseif ( $real_mime != $type ) {
|
||||
/**
|
||||
* Filter the list mapping image mime types to their respective extensions.
|
||||
*
|
||||
@@ -2129,10 +2130,10 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
) );
|
||||
|
||||
// Replace whatever is after the last period in the filename with the correct extension
|
||||
if ( ! empty( $mime_to_ext[ $imgstats['mime'] ] ) ) {
|
||||
if ( ! empty( $mime_to_ext[ $real_mime ] ) ) {
|
||||
$filename_parts = explode( '.', $filename );
|
||||
array_pop( $filename_parts );
|
||||
$filename_parts[] = $mime_to_ext[ $imgstats['mime'] ];
|
||||
$filename_parts[] = $mime_to_ext[ $real_mime ];
|
||||
$new_filename = implode( '.', $filename_parts );
|
||||
|
||||
if ( $new_filename != $filename ) {
|
||||
@@ -2142,8 +2143,20 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
$wp_filetype = wp_check_filetype( $new_filename, $mimes );
|
||||
$ext = $wp_filetype['ext'];
|
||||
$type = $wp_filetype['type'];
|
||||
} else {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
} elseif ( function_exists( 'finfo_file' ) ) {
|
||||
// Use finfo_file if available to validate non-image files.
|
||||
$finfo = finfo_open( FILEINFO_MIME_TYPE );
|
||||
$real_mime = finfo_file( $finfo, $file );
|
||||
finfo_close( $finfo );
|
||||
|
||||
// If the extension does not match the file's real type, return false.
|
||||
if ( $real_mime !== $type ) {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2161,6 +2174,38 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the real mime type of an image file.
|
||||
*
|
||||
* This depends on exif_imagetype() or getimagesize() to determine real mime types.
|
||||
*
|
||||
* @since 4.7.1
|
||||
*
|
||||
* @param string $file Full path to the file.
|
||||
* @return string|false The actual mime type or false if the type cannot be determined.
|
||||
*/
|
||||
function wp_get_image_mime( $file ) {
|
||||
/*
|
||||
* Use exif_imagetype() to check the mimetype if available or fall back to
|
||||
* getimagesize() if exif isn't avaialbe. If either function throws an Exception
|
||||
* we assume the file could not be validated.
|
||||
*/
|
||||
try {
|
||||
if ( is_callable( 'exif_imagetype' ) ) {
|
||||
$mime = image_type_to_mime_type( exif_imagetype( $file ) );
|
||||
} elseif ( function_exists( 'getimagesize' ) ) {
|
||||
$imagesize = getimagesize( $file );
|
||||
$mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
|
||||
} else {
|
||||
$mime = false;
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
$mime = false;
|
||||
}
|
||||
|
||||
return $mime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve list of mime types and file extensions.
|
||||
*
|
||||
|
||||
@@ -469,7 +469,7 @@ function wp_http_validate_url( $url ) {
|
||||
|
||||
if ( ! $same_host ) {
|
||||
$host = trim( $parsed_url['host'], '.' );
|
||||
if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) {
|
||||
if ( preg_match( '#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host ) ) {
|
||||
$ip = $host;
|
||||
} else {
|
||||
$ip = gethostbyname( $host );
|
||||
@@ -478,7 +478,7 @@ function wp_http_validate_url( $url ) {
|
||||
}
|
||||
if ( $ip ) {
|
||||
$parts = array_map( 'intval', explode( '.', $ip ) );
|
||||
if ( 127 === $parts[0] || 10 === $parts[0]
|
||||
if ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0]
|
||||
|| ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
|
||||
|| ( 192 === $parts[0] && 168 === $parts[1] )
|
||||
) {
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -328,15 +328,24 @@ function uploadError(fileObj, errorCode, message, uploader) {
|
||||
}
|
||||
}
|
||||
|
||||
function uploadSizeError( up, file, over100mb ) {
|
||||
var message;
|
||||
function uploadSizeError( up, file ) {
|
||||
var message, errorDiv;
|
||||
|
||||
if ( over100mb )
|
||||
message = pluploadL10n.big_upload_queued.replace('%s', file.name) + ' ' + pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>');
|
||||
else
|
||||
message = pluploadL10n.file_exceeds_size_limit.replace('%s', file.name);
|
||||
message = pluploadL10n.file_exceeds_size_limit.replace('%s', file.name);
|
||||
|
||||
jQuery('#media-items').append('<div id="media-item-' + file.id + '" class="media-item error"><p>' + message + '</p></div>');
|
||||
// Construct the error div.
|
||||
errorDiv = jQuery( '<div />' )
|
||||
.attr( {
|
||||
'id': 'media-item-' + file.id,
|
||||
'class': 'media-item error'
|
||||
} )
|
||||
.append(
|
||||
jQuery( '<p />' )
|
||||
.text( message )
|
||||
);
|
||||
|
||||
// Append the error.
|
||||
jQuery('#media-items').append( errorDiv );
|
||||
up.removeFile(file);
|
||||
}
|
||||
|
||||
|
||||
2
wp-includes/js/plupload/handlers.min.js
vendored
2
wp-includes/js/plupload/handlers.min.js
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -381,16 +381,18 @@ tinymce.PluginManager.add('charmap', function(editor) {
|
||||
});
|
||||
}
|
||||
|
||||
editor.addCommand('mceShowCharmap', showDialog);
|
||||
|
||||
editor.addButton('charmap', {
|
||||
icon: 'charmap',
|
||||
tooltip: 'Special character',
|
||||
onclick: showDialog
|
||||
cmd: 'mceShowCharmap'
|
||||
});
|
||||
|
||||
editor.addMenuItem('charmap', {
|
||||
icon: 'charmap',
|
||||
text: 'Special character',
|
||||
onclick: showDialog,
|
||||
cmd: 'mceShowCharmap',
|
||||
context: 'insert'
|
||||
});
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
@@ -349,24 +349,22 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
dom.remove(li);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
if (ulParent.nodeName == 'LI') {
|
||||
ul = ulParent;
|
||||
newBlock = createNewTextBlock(li, 'LI');
|
||||
} else if (isListNode(ulParent)) {
|
||||
newBlock = createNewTextBlock(li, 'LI');
|
||||
} else {
|
||||
newBlock = createNewTextBlock(li);
|
||||
}
|
||||
|
||||
splitList(ul, li, newBlock);
|
||||
normalizeList(ul.parentNode);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (ulParent.nodeName == 'LI') {
|
||||
ul = ulParent;
|
||||
newBlock = createNewTextBlock(li, 'LI');
|
||||
} else if (isListNode(ulParent)) {
|
||||
newBlock = createNewTextBlock(li, 'LI');
|
||||
} else {
|
||||
newBlock = createNewTextBlock(li);
|
||||
}
|
||||
|
||||
splitList(ul, li, newBlock);
|
||||
normalizeList(ul.parentNode);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function indent(li) {
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
|
||||
tinymce.PluginManager.add('media', function(editor, url) {
|
||||
var urlPatterns = [
|
||||
{regex: /youtu\.be\/([\w\-.]+)/, type: 'iframe', w: 425, h: 350, url: '//www.youtube.com/embed/$1'},
|
||||
{regex: /youtube\.com(.+)v=([^&]+)/, type: 'iframe', w: 425, h: 350, url: '//www.youtube.com/embed/$2'},
|
||||
{regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc'},
|
||||
{regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: "iframe", w: 425, h: 350, url: "//player.vimeo.com/video/$2?title=0&byline=0"},
|
||||
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"'}
|
||||
{regex: /youtu\.be\/([\w\-.]+)/, type: 'iframe', w: 425, h: 350, url: '//www.youtube.com/embed/$1', allowFullscreen: true},
|
||||
{regex: /youtube\.com(.+)v=([^&]+)/, type: 'iframe', w: 425, h: 350, url: '//www.youtube.com/embed/$2', allowFullscreen: true},
|
||||
{regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', allowfullscreen: true},
|
||||
{regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: "iframe", w: 425, h: 350, url: "//player.vimeo.com/video/$2?title=0&byline=0", allowfullscreen: true},
|
||||
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false}
|
||||
];
|
||||
|
||||
var embedChange = (tinymce.Env.ie && tinymce.Env.ie <= 8) ? 'onChange' : 'onInput';
|
||||
@@ -265,6 +265,7 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
|
||||
data.source1 = url;
|
||||
data.type = pattern.type;
|
||||
data.allowFullscreen = pattern.allowFullscreen;
|
||||
data.width = data.width || pattern.w;
|
||||
data.height = data.height || pattern.h;
|
||||
}
|
||||
@@ -288,7 +289,8 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
});
|
||||
|
||||
if (data.type == "iframe") {
|
||||
html += '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"></iframe>';
|
||||
var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : '';
|
||||
html += '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
|
||||
} else if (data.source1mime == "application/x-shockwave-flash") {
|
||||
html += '<object data="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
|
||||
|
||||
@@ -394,7 +396,7 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
return html;
|
||||
}
|
||||
|
||||
var writer = new tinymce.html.Writer();
|
||||
var writer = new tinymce.html.Writer(), blocked;
|
||||
|
||||
new tinymce.html.SaxParser({
|
||||
validate: false,
|
||||
@@ -414,6 +416,8 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
},
|
||||
|
||||
start: function(name, attrs, empty) {
|
||||
blocked = true;
|
||||
|
||||
if (name == 'script' || name == 'noscript') {
|
||||
return;
|
||||
}
|
||||
@@ -422,13 +426,18 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
if (attrs[i].name.indexOf('on') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (attrs[i].name == 'style') {
|
||||
attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
|
||||
}
|
||||
}
|
||||
|
||||
writer.start(name, attrs, empty);
|
||||
blocked = false;
|
||||
},
|
||||
|
||||
end: function(name) {
|
||||
if (name == 'script' || name == 'noscript') {
|
||||
if (blocked) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -779,4 +788,6 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
context: 'insert',
|
||||
prependToContext: true
|
||||
});
|
||||
|
||||
this.showDialog = showDialog;
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -63,10 +63,12 @@
|
||||
}
|
||||
|
||||
function expose(ids) {
|
||||
for (var i = 0; i < ids.length; i++) {
|
||||
var target = exports;
|
||||
var id = ids[i];
|
||||
var fragments = id.split(/[.\/]/);
|
||||
var i, target, id, fragments, privateModules;
|
||||
|
||||
for (i = 0; i < ids.length; i++) {
|
||||
target = exports;
|
||||
id = ids[i];
|
||||
fragments = id.split(/[.\/]/);
|
||||
|
||||
for (var fi = 0; fi < fragments.length - 1; ++fi) {
|
||||
if (target[fragments[fi]] === undefined) {
|
||||
@@ -78,6 +80,21 @@
|
||||
|
||||
target[fragments[fragments.length - 1]] = modules[id];
|
||||
}
|
||||
|
||||
// Expose private modules for unit tests
|
||||
if (exports.AMDLC_TESTS) {
|
||||
privateModules = exports.privateModules || {};
|
||||
|
||||
for (id in modules) {
|
||||
privateModules[id] = modules[id];
|
||||
}
|
||||
|
||||
for (i = 0; i < ids.length; i++) {
|
||||
delete privateModules[ids[i]];
|
||||
}
|
||||
|
||||
exports.privateModules = privateModules;
|
||||
}
|
||||
}
|
||||
|
||||
// Included from: js/tinymce/plugins/paste/classes/Utils.js
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -61,14 +61,16 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
} );
|
||||
|
||||
editor.once( 'preinit', function() {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_img_alignleft',
|
||||
'wp_img_aligncenter',
|
||||
'wp_img_alignright',
|
||||
'wp_img_alignnone',
|
||||
'wp_img_edit',
|
||||
'wp_img_remove'
|
||||
] );
|
||||
if ( editor.wp && editor.wp._createToolbar ) {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_img_alignleft',
|
||||
'wp_img_aligncenter',
|
||||
'wp_img_alignright',
|
||||
'wp_img_alignnone',
|
||||
'wp_img_edit',
|
||||
'wp_img_remove'
|
||||
] );
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'wptoolbar', function( event ) {
|
||||
@@ -88,7 +90,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
editor.selection.select( node );
|
||||
editor.nodeChanged();
|
||||
}, 200 );
|
||||
} else {
|
||||
} else if ( toolbar ) {
|
||||
toolbar.hide();
|
||||
}
|
||||
} );
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -136,11 +136,13 @@
|
||||
} );
|
||||
|
||||
editor.on( 'preinit', function() {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_link_preview',
|
||||
'wp_link_edit',
|
||||
'wp_link_remove'
|
||||
], true );
|
||||
if ( editor.wp && editor.wp._createToolbar ) {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_link_preview',
|
||||
'wp_link_edit',
|
||||
'wp_link_remove'
|
||||
], true );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} )( window.tinymce );
|
||||
|
||||
@@ -1 +1 @@
|
||||
!function(a){a.ui.WPLinkPreview=a.ui.Control.extend({url:"#",renderHtml:function(){return'<div id="'+this._id+'" class="wp-link-preview"><a href="'+this.url+'" target="_blank" tabindex="-1">'+this.url+"</a></div>"},setURL:function(b){var c,d;this.url!==b&&(this.url=b,b=window.decodeURIComponent(b),b=b.replace(/^(?:https?:)?\/\/(?:www\.)?/,""),-1!==(c=b.indexOf("?"))&&(b=b.slice(0,c)),-1!==(c=b.indexOf("#"))&&(b=b.slice(0,c)),b=b.replace(/(?:index)?\.html$/,""),"/"===b.charAt(b.length-1)&&(b=b.slice(0,-1)),b.length>40&&-1!==(c=b.indexOf("/"))&&-1!==(d=b.lastIndexOf("/"))&&d!==c&&(c+b.length-d<40&&(d=-(40-(c+1))),b=b.slice(0,c+1)+"\u2026"+b.slice(d)),a.$(this.getEl().firstChild).attr("href",this.url).text(b))}}),a.PluginManager.add("wplink",function(b){var c;b.addCommand("WP_Link",function(){window.wpLink&&window.wpLink.open(b.id)}),b.addShortcut("Alt+Shift+A","","WP_Link"),b.addShortcut("Meta+K","","WP_Link"),b.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),b.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),b.addMenuItem("link",{icon:"link",text:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),b.on("pastepreprocess",function(c){var d=c.content,e=/^(?:https?:)?\/\/\S+$/i;b.selection.isCollapsed()||e.test(b.selection.getContent())||(d=d.replace(/<[^>]+>/g,""),d=a.trim(d),e.test(d)&&(b.execCommand("mceInsertLink",!1,{href:b.dom.decode(d)}),c.preventDefault()))}),b.addButton("wp_link_preview",{type:"WPLinkPreview",onPostRender:function(){var a=this;b.on("wptoolbar",function(d){var e,f,g=b.dom.getParent(d.element,"a");g&&(e=b.$(g),f=e.attr("href"),f&&!e.find("img").length&&(a.setURL(f),d.element=g,d.toolbar=c))})}}),b.addButton("wp_link_edit",{tooltip:"Edit ",icon:"dashicon dashicons-edit",cmd:"WP_Link"}),b.addButton("wp_link_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",cmd:"unlink"}),b.on("preinit",function(){c=b.wp._createToolbar(["wp_link_preview","wp_link_edit","wp_link_remove"],!0)})})}(window.tinymce);
|
||||
!function(a){a.ui.WPLinkPreview=a.ui.Control.extend({url:"#",renderHtml:function(){return'<div id="'+this._id+'" class="wp-link-preview"><a href="'+this.url+'" target="_blank" tabindex="-1">'+this.url+"</a></div>"},setURL:function(b){var c,d;this.url!==b&&(this.url=b,b=window.decodeURIComponent(b),b=b.replace(/^(?:https?:)?\/\/(?:www\.)?/,""),-1!==(c=b.indexOf("?"))&&(b=b.slice(0,c)),-1!==(c=b.indexOf("#"))&&(b=b.slice(0,c)),b=b.replace(/(?:index)?\.html$/,""),"/"===b.charAt(b.length-1)&&(b=b.slice(0,-1)),b.length>40&&-1!==(c=b.indexOf("/"))&&-1!==(d=b.lastIndexOf("/"))&&d!==c&&(c+b.length-d<40&&(d=-(40-(c+1))),b=b.slice(0,c+1)+"\u2026"+b.slice(d)),a.$(this.getEl().firstChild).attr("href",this.url).text(b))}}),a.PluginManager.add("wplink",function(b){var c;b.addCommand("WP_Link",function(){window.wpLink&&window.wpLink.open(b.id)}),b.addShortcut("Alt+Shift+A","","WP_Link"),b.addShortcut("Meta+K","","WP_Link"),b.addButton("link",{icon:"link",tooltip:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]"}),b.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink"}),b.addMenuItem("link",{icon:"link",text:"Insert/edit link",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0}),b.on("pastepreprocess",function(c){var d=c.content,e=/^(?:https?:)?\/\/\S+$/i;b.selection.isCollapsed()||e.test(b.selection.getContent())||(d=d.replace(/<[^>]+>/g,""),d=a.trim(d),e.test(d)&&(b.execCommand("mceInsertLink",!1,{href:b.dom.decode(d)}),c.preventDefault()))}),b.addButton("wp_link_preview",{type:"WPLinkPreview",onPostRender:function(){var a=this;b.on("wptoolbar",function(d){var e,f,g=b.dom.getParent(d.element,"a");g&&(e=b.$(g),f=e.attr("href"),f&&!e.find("img").length&&(a.setURL(f),d.element=g,d.toolbar=c))})}}),b.addButton("wp_link_edit",{tooltip:"Edit ",icon:"dashicon dashicons-edit",cmd:"WP_Link"}),b.addButton("wp_link_remove",{tooltip:"Remove",icon:"dashicon dashicons-no",cmd:"unlink"}),b.on("preinit",function(){b.wp&&b.wp._createToolbar&&(c=b.wp._createToolbar(["wp_link_preview","wp_link_edit","wp_link_remove"],!0))})})}(window.tinymce);
|
||||
@@ -713,10 +713,12 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
} );
|
||||
|
||||
editor.once( 'preinit', function() {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_view_edit',
|
||||
'wp_view_remove'
|
||||
] );
|
||||
if ( editor.wp && editor.wp._createToolbar ) {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_view_edit',
|
||||
'wp_view_remove'
|
||||
] );
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'wptoolbar', function( event ) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}
|
||||
.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}
|
||||
@@ -1 +1 @@
|
||||
body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}
|
||||
body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
var defaultToolbar = "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | " +
|
||||
"bullist numlist outdent indent | link image";
|
||||
|
||||
function createToolbar(items) {
|
||||
function createToolbar(items, size) {
|
||||
var toolbarItems = [], buttonGroup;
|
||||
|
||||
if (!items) {
|
||||
@@ -88,12 +88,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
buttonGroup = null;
|
||||
} else {
|
||||
if (Factory.has(item)) {
|
||||
item = {type: item};
|
||||
|
||||
if (settings.toolbar_items_size) {
|
||||
item.size = settings.toolbar_items_size;
|
||||
}
|
||||
|
||||
item = {type: item, size: size};
|
||||
toolbarItems.push(item);
|
||||
buttonGroup = null;
|
||||
} else {
|
||||
@@ -112,10 +107,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
}
|
||||
|
||||
item.type = item.type || 'button';
|
||||
|
||||
if (settings.toolbar_items_size) {
|
||||
item.size = settings.toolbar_items_size;
|
||||
}
|
||||
item.size = size;
|
||||
|
||||
item = Factory.create(item);
|
||||
buttonGroup.items.push(item);
|
||||
@@ -140,14 +132,15 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
/**
|
||||
* Creates the toolbars from config and returns a toolbar array.
|
||||
*
|
||||
* @param {String} size Optional toolbar item size.
|
||||
* @return {Array} Array with toolbars.
|
||||
*/
|
||||
function createToolbars() {
|
||||
function createToolbars(size) {
|
||||
var toolbars = [];
|
||||
|
||||
function addToolbar(items) {
|
||||
if (items) {
|
||||
toolbars.push(createToolbar(items));
|
||||
toolbars.push(createToolbar(items, size));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -670,7 +663,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
border: 1,
|
||||
items: [
|
||||
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
|
||||
createToolbars()
|
||||
createToolbars(settings.toolbar_items_size)
|
||||
]
|
||||
});
|
||||
|
||||
@@ -747,7 +740,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
border: 1,
|
||||
items: [
|
||||
settings.menubar === false ? null : {type: 'menubar', border: '0 0 1 0', items: createMenuButtons()},
|
||||
createToolbars(),
|
||||
createToolbars(settings.toolbar_items_size),
|
||||
{type: 'panel', name: 'iframe', layout: 'stack', classes: 'edit-area', html: '', border: '1 0 0 0'}
|
||||
]
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
24
wp-includes/js/tinymce/tinymce.min.js
vendored
24
wp-includes/js/tinymce/tinymce.min.js
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -50,7 +50,7 @@ var wpAjax = jQuery.extend( {
|
||||
return true;
|
||||
},
|
||||
invalidateForm: function ( selector ) {
|
||||
return jQuery( selector ).addClass( 'form-invalid' ).find('input:visible').change( function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
|
||||
return jQuery( selector ).addClass( 'form-invalid' ).find('input').one( 'change wp-check-valid-field', function() { jQuery(this).closest('.form-invalid').removeClass( 'form-invalid' ); } );
|
||||
},
|
||||
validateForm: function( selector ) {
|
||||
selector = jQuery( selector );
|
||||
|
||||
2
wp-includes/js/wp-ajax-response.min.js
vendored
2
wp-includes/js/wp-ajax-response.min.js
vendored
@@ -1 +1 @@
|
||||
var wpAjax=jQuery.extend({unserialize:function(a){var b,c,d,e,f={};if(!a)return f;b=a.split("?"),b[1]&&(a=b[1]),c=a.split("&");for(d in c)(!jQuery.isFunction(c.hasOwnProperty)||c.hasOwnProperty(d))&&(e=c[d].split("="),f[e[0]]=e[1]);return f},parseAjaxResponse:function(a,b,c){var d={},e=jQuery("#"+b).empty(),f="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(d.responses=[],d.errors=!1,jQuery("response",a).each(function(){var b,e=jQuery(this),g=jQuery(this.firstChild);b={action:e.attr("action"),what:g.get(0).nodeName,id:g.attr("id"),oldId:g.attr("old_id"),position:g.attr("position")},b.data=jQuery("response_data",g).text(),b.supplemental={},jQuery("supplemental",g).children().each(function(){b.supplemental[this.nodeName]=jQuery(this).text()}).size()||(b.supplemental=!1),b.errors=[],jQuery("wp_error",g).each(function(){var e,g,h,i=jQuery(this).attr("code");e={code:i,message:this.firstChild.nodeValue,data:!1},g=jQuery('wp_error_data[code="'+i+'"]',a),g&&(e.data=g.get()),h=jQuery("form-field",g).text(),h&&(i=h),c&&wpAjax.invalidateForm(jQuery("#"+c+' :input[name="'+i+'"]').parents(".form-field:first")),f+="<p>"+e.message+"</p>",b.errors.push(e),d.errors=!0}).size()||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('<div class="error">'+f+"</div>"),d):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):(a=parseInt(a,10),-1==a?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0===a?!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>"):!0)},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input:visible").change(function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){return a=jQuery(a),!wpAjax.invalidateForm(a.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).size()}},wpAjax||{noPerm:"You do not have permission to do that.",broken:"An unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})});
|
||||
var wpAjax=jQuery.extend({unserialize:function(a){var b,c,d,e,f={};if(!a)return f;b=a.split("?"),b[1]&&(a=b[1]),c=a.split("&");for(d in c)(!jQuery.isFunction(c.hasOwnProperty)||c.hasOwnProperty(d))&&(e=c[d].split("="),f[e[0]]=e[1]);return f},parseAjaxResponse:function(a,b,c){var d={},e=jQuery("#"+b).empty(),f="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(d.responses=[],d.errors=!1,jQuery("response",a).each(function(){var b,e=jQuery(this),g=jQuery(this.firstChild);b={action:e.attr("action"),what:g.get(0).nodeName,id:g.attr("id"),oldId:g.attr("old_id"),position:g.attr("position")},b.data=jQuery("response_data",g).text(),b.supplemental={},jQuery("supplemental",g).children().each(function(){b.supplemental[this.nodeName]=jQuery(this).text()}).size()||(b.supplemental=!1),b.errors=[],jQuery("wp_error",g).each(function(){var e,g,h,i=jQuery(this).attr("code");e={code:i,message:this.firstChild.nodeValue,data:!1},g=jQuery('wp_error_data[code="'+i+'"]',a),g&&(e.data=g.get()),h=jQuery("form-field",g).text(),h&&(i=h),c&&wpAjax.invalidateForm(jQuery("#"+c+' :input[name="'+i+'"]').parents(".form-field:first")),f+="<p>"+e.message+"</p>",b.errors.push(e),d.errors=!0}).size()||(b.errors=!1),d.responses.push(b)}),f.length&&e.html('<div class="error">'+f+"</div>"),d):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):(a=parseInt(a,10),-1==a?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0===a?!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>"):!0)},invalidateForm:function(a){return jQuery(a).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(a){return a=jQuery(a),!wpAjax.invalidateForm(a.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).size()}},wpAjax||{noPerm:"You do not have permission to do that.",broken:"An unidentified error has occurred."});jQuery(document).ready(function(a){a("form.validate").submit(function(){return wpAjax.validateForm(a(this))})});
|
||||
@@ -863,6 +863,8 @@ function img_caption_shortcode( $attr, $content = null ) {
|
||||
$content = $matches[1];
|
||||
$attr['caption'] = trim( $matches[2] );
|
||||
}
|
||||
} elseif ( strpos( $attr['caption'], '<' ) !== false ) {
|
||||
$attr['caption'] = wp_kses( $attr['caption'], 'post' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2399,7 +2401,7 @@ function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
|
||||
*/
|
||||
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
|
||||
global $wp_embed;
|
||||
$embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" );
|
||||
$embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );
|
||||
|
||||
/**
|
||||
* Filter the YoutTube embed output.
|
||||
|
||||
@@ -731,7 +731,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
|
||||
function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {
|
||||
global $wpdb;
|
||||
|
||||
$key = substr( md5( time() . rand() . $domain ), 0, 16 );
|
||||
$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );
|
||||
$meta = serialize($meta);
|
||||
|
||||
$wpdb->insert( $wpdb->signups, array(
|
||||
@@ -768,7 +768,7 @@ function wpmu_signup_user( $user, $user_email, $meta = array() ) {
|
||||
// Format data
|
||||
$user = preg_replace( '/\s+/', '', sanitize_user( $user, true ) );
|
||||
$user_email = sanitize_email( $user_email );
|
||||
$key = substr( md5( time() . rand() . $user_email ), 0, 16 );
|
||||
$key = substr( md5( time() . wp_rand() . $user_email ), 0, 16 );
|
||||
$meta = serialize($meta);
|
||||
|
||||
$wpdb->insert( $wpdb->signups, array(
|
||||
|
||||
@@ -1021,18 +1021,14 @@ function auth_redirect() {
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_user_admin() ) {
|
||||
$scheme = 'logged_in';
|
||||
} else {
|
||||
/**
|
||||
* Filter the authentication redirect scheme.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param string $scheme Authentication redirect scheme. Default empty.
|
||||
*/
|
||||
$scheme = apply_filters( 'auth_redirect_scheme', '' );
|
||||
}
|
||||
/**
|
||||
* Filters the authentication redirect scheme.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param string $scheme Authentication redirect scheme. Default empty.
|
||||
*/
|
||||
$scheme = apply_filters( 'auth_redirect_scheme', '' );
|
||||
|
||||
if ( $user_id = wp_validate_auth_cookie( '', $scheme) ) {
|
||||
/**
|
||||
@@ -1304,7 +1300,7 @@ if ( !function_exists('wp_validate_redirect') ) :
|
||||
* @return string redirect-sanitized URL
|
||||
**/
|
||||
function wp_validate_redirect($location, $default = '') {
|
||||
$location = trim( $location );
|
||||
$location = trim( $location, " \t\n\r\0\x08\x0B" );
|
||||
// browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'
|
||||
if ( substr($location, 0, 2) == '//' )
|
||||
$location = 'http:' . $location;
|
||||
@@ -1312,7 +1308,8 @@ function wp_validate_redirect($location, $default = '') {
|
||||
// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
|
||||
$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
|
||||
|
||||
$lp = parse_url($test);
|
||||
// @-operator is used to prevent possible warnings in PHP < 5.3.3.
|
||||
$lp = @parse_url($test);
|
||||
|
||||
// Give up if malformed URL
|
||||
if ( false === $lp )
|
||||
@@ -1322,9 +1319,17 @@ function wp_validate_redirect($location, $default = '') {
|
||||
if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
|
||||
return $default;
|
||||
|
||||
// Reject if scheme is set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
|
||||
if ( isset($lp['scheme']) && !isset($lp['host']) )
|
||||
// Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
|
||||
if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
// Reject malformed components parse_url() can return on odd inputs.
|
||||
foreach ( array( 'user', 'pass', 'host' ) as $component ) {
|
||||
if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
$wpp = parse_url(home_url());
|
||||
|
||||
@@ -1689,13 +1694,23 @@ if ( !function_exists('wp_new_user_notification') ) :
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
|
||||
* @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter.
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
* @param string $notify Whether admin and user should be notified ('both') or
|
||||
* only the admin ('admin' or empty).
|
||||
* @global wpdb $wpdb WordPress database object for queries.
|
||||
* @global PasswordHash $wp_hasher Portable PHP password hashing framework instance.
|
||||
*
|
||||
* @param int $user_id User ID.
|
||||
* @param null $deprecated Not used (argument deprecated).
|
||||
* @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
|
||||
* string (admin only), or 'both' (admin and user). The empty string value was kept
|
||||
* for backward-compatibility purposes with the renamed parameter. Default empty.
|
||||
*/
|
||||
function wp_new_user_notification( $user_id, $notify = '' ) {
|
||||
global $wpdb;
|
||||
function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
|
||||
if ( $deprecated !== null ) {
|
||||
_deprecated_argument( __FUNCTION__, '4.3.1' );
|
||||
}
|
||||
|
||||
global $wpdb, $wp_hasher;
|
||||
$user = get_userdata( $user_id );
|
||||
|
||||
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
|
||||
|
||||
@@ -1597,7 +1597,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
|
||||
* @param bool $icon Whether to include an icon. Default false.
|
||||
* @param string|bool $text If string, will be link text. Default false.
|
||||
*/
|
||||
return apply_filters( 'wp_get_attachment_link', "<a href='$url'>$link_text</a>", $id, $size, $permalink, $icon, $text );
|
||||
return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2941,14 +2941,15 @@ class WP_Query {
|
||||
|
||||
if ( 'any' == $post_type ) {
|
||||
$in_search_post_types = get_post_types( array('exclude_from_search' => false) );
|
||||
if ( empty( $in_search_post_types ) )
|
||||
if ( empty( $in_search_post_types ) ) {
|
||||
$where .= ' AND 1=0 ';
|
||||
else
|
||||
$where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $in_search_post_types ) . "')";
|
||||
} else {
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')";
|
||||
}
|
||||
} elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
|
||||
$where .= " AND $wpdb->posts.post_type IN ('" . join("', '", $post_type) . "')";
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')";
|
||||
} elseif ( ! empty( $post_type ) ) {
|
||||
$where .= " AND $wpdb->posts.post_type = '$post_type'";
|
||||
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type );
|
||||
$post_type_object = get_post_type_object ( $post_type );
|
||||
} elseif ( $this->is_attachment ) {
|
||||
$where .= " AND $wpdb->posts.post_type = 'attachment'";
|
||||
|
||||
@@ -330,7 +330,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), false, 1 );
|
||||
|
||||
$scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.17.0', 1 );
|
||||
$scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.17.0-a', 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'mediaelement', 'mejsL10n', array(
|
||||
'language' => get_bloginfo( 'language' ),
|
||||
'strings' => array(
|
||||
|
||||
@@ -462,6 +462,15 @@ function shortcode_parse_atts($text) {
|
||||
elseif (isset($m[8]))
|
||||
$atts[] = stripcslashes($m[8]);
|
||||
}
|
||||
|
||||
// Reject any unclosed HTML elements
|
||||
foreach( $atts as &$value ) {
|
||||
if ( false !== strpos( $value, '<' ) ) {
|
||||
if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) {
|
||||
$value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$atts = ltrim($text);
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ function get_objects_in_term( $term_ids, $taxonomies, $args = array() ) {
|
||||
|
||||
$term_ids = array_map('intval', $term_ids );
|
||||
|
||||
$taxonomies = "'" . implode( "', '", $taxonomies ) . "'";
|
||||
$taxonomies = "'" . implode( "', '", array_map( 'esc_sql', $taxonomies ) ) . "'";
|
||||
$term_ids = "'" . implode( "', '", $term_ids ) . "'";
|
||||
|
||||
$object_ids = $wpdb->get_col("SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ($taxonomies) AND tt.term_id IN ($term_ids) ORDER BY tr.object_id $order");
|
||||
@@ -1810,7 +1810,7 @@ function get_terms( $taxonomies, $args = '' ) {
|
||||
$order = 'ASC';
|
||||
}
|
||||
|
||||
$where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
|
||||
$where = "tt.taxonomy IN ('" . implode("', '", array_map( 'esc_sql', $taxonomies ) ) . "')";
|
||||
|
||||
$exclude = $args['exclude'];
|
||||
$exclude_tree = $args['exclude_tree'];
|
||||
@@ -2739,7 +2739,7 @@ function wp_get_object_terms($object_ids, $taxonomies, $args = array()) {
|
||||
|
||||
$taxonomy_array = $taxonomies;
|
||||
$object_id_array = $object_ids;
|
||||
$taxonomies = "'" . implode("', '", $taxonomies) . "'";
|
||||
$taxonomies = "'" . implode("', '", array_map( 'esc_sql', $taxonomies ) ) . "'";
|
||||
$object_ids = implode(', ', $object_ids);
|
||||
|
||||
$select_this = '';
|
||||
@@ -4437,15 +4437,15 @@ function _wp_batch_split_terms() {
|
||||
}
|
||||
|
||||
/**
|
||||
* In order to avoid the wp_batch_split_terms() job being accidentally removed,
|
||||
* In order to avoid the _wp_batch_split_terms() job being accidentally removed,
|
||||
* check that it's still scheduled while we haven't finished splitting terms.
|
||||
*
|
||||
* @ignore
|
||||
* @since 4.3.0
|
||||
*/
|
||||
function _wp_check_for_scheduled_split_terms() {
|
||||
if ( ! get_option( 'finished_splitting_shared_terms' ) && ! wp_next_scheduled( 'wp_batch_split_terms' ) ) {
|
||||
wp_schedule_single_event( 'wp_batch_split_terms', time() + MINUTE_IN_SECONDS );
|
||||
if ( ! get_option( 'finished_splitting_shared_terms' ) && ! wp_next_scheduled( 'wp_split_shared_term_batch' ) ) {
|
||||
wp_schedule_single_event( time() + MINUTE_IN_SECONDS, 'wp_split_shared_term_batch' );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -645,19 +645,8 @@ function wp_schedule_update_checks() {
|
||||
if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
|
||||
wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
|
||||
|
||||
if ( ! wp_next_scheduled( 'wp_maybe_auto_update' ) && ! defined( 'WP_INSTALLING' ) ) {
|
||||
// Schedule auto updates for 7 a.m. and 7 p.m. in the timezone of the site.
|
||||
$next = strtotime( 'today 7am' );
|
||||
$now = time();
|
||||
// Find the next instance of 7 a.m. or 7 p.m., but skip it if it is within 3 hours from now.
|
||||
while ( ( $now + 3 * HOUR_IN_SECONDS ) > $next ) {
|
||||
$next += 12 * HOUR_IN_SECONDS;
|
||||
}
|
||||
$next = $next - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS;
|
||||
// Add a random number of minutes, so we don't have all sites trying to update exactly on the hour
|
||||
$next = $next + rand( 0, 59 ) * MINUTE_IN_SECONDS;
|
||||
wp_schedule_event( $next, 'twicedaily', 'wp_maybe_auto_update' );
|
||||
}
|
||||
if ( ( wp_next_scheduled( 'wp_maybe_auto_update' ) > ( time() + HOUR_IN_SECONDS ) ) && ! defined('WP_INSTALLING') )
|
||||
wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user