Compare commits
122 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc55912114 | ||
|
|
03c2d89d0a | ||
|
|
2544e89df4 | ||
|
|
f175cf83a7 | ||
|
|
499c907011 | ||
|
|
27f0839d04 | ||
|
|
f501f7d79b | ||
|
|
049d99e977 | ||
|
|
166492f860 | ||
|
|
9548cae7ec | ||
|
|
b12e78ee0b | ||
|
|
c359dde932 | ||
|
|
20821b59c0 | ||
|
|
0f9e4ca0a2 | ||
|
|
8c59b4a3c2 | ||
|
|
fdc41b55e7 | ||
|
|
f76869ca2f | ||
|
|
7b4f9a5118 | ||
|
|
1242539c0e | ||
|
|
33f4539c6e | ||
|
|
b3a9479bd3 | ||
|
|
a32075cd83 | ||
|
|
010a30cf09 | ||
|
|
d86c7ad402 | ||
|
|
7bd776bdb3 | ||
|
|
dfc71aee34 | ||
|
|
a5be721238 | ||
|
|
1bb4687f0b | ||
|
|
e00499f8df | ||
|
|
b20bad3d40 | ||
|
|
ad514185cd | ||
|
|
dc4313f798 | ||
|
|
b9381e6229 | ||
|
|
ae68925e49 | ||
|
|
62ccb52bbc | ||
|
|
54e04cd70e | ||
|
|
4f2919a7ef | ||
|
|
86c462ab7e | ||
|
|
d75574cd84 | ||
|
|
726b806eab | ||
|
|
53c05552f3 | ||
|
|
9222292ccb | ||
|
|
47c076a77b | ||
|
|
3995f1e60f | ||
|
|
c5713fc570 | ||
|
|
2aba074c5b | ||
|
|
8101b2aa4d | ||
|
|
9eb5084390 | ||
|
|
5f52157d46 | ||
|
|
3fdaf059b9 | ||
|
|
a59f4bc10f | ||
|
|
d290d5c257 | ||
|
|
c38ae9a68f | ||
|
|
27433a5d25 | ||
|
|
1b16fc95d8 | ||
|
|
7b17c71213 | ||
|
|
109695b948 | ||
|
|
3e77adc619 | ||
|
|
a9b03b1b80 | ||
|
|
40074d31a0 | ||
|
|
460edb5519 | ||
|
|
07e1f9a6ca | ||
|
|
846bd22a79 | ||
|
|
1647b11bf4 | ||
|
|
a905eb3690 | ||
|
|
d75fad697d | ||
|
|
b7d54dd918 | ||
|
|
d82e0f5c86 | ||
|
|
9cbea2762a | ||
|
|
93ba8ea6fb | ||
|
|
795af804ba | ||
|
|
a0153f27c8 | ||
|
|
e10af224e2 | ||
|
|
a9897ef218 | ||
|
|
546dcf7fed | ||
|
|
30f39b93be | ||
|
|
fee9368d46 | ||
|
|
b9d2c50edd | ||
|
|
be70069a0a | ||
|
|
7eccdc89e7 | ||
|
|
7cdc8af10c | ||
|
|
cbfc476b43 | ||
|
|
a17fcecfda | ||
|
|
fd423f720e | ||
|
|
74314b2ddb | ||
|
|
6be40b7a13 | ||
|
|
96da852a31 | ||
|
|
6ce522414f | ||
|
|
fc475c2d71 | ||
|
|
ff0656e37c | ||
|
|
8575d4e180 | ||
|
|
aef4b48187 | ||
|
|
940c2238ec | ||
|
|
ec08f02aa4 | ||
|
|
471cb97374 | ||
|
|
e875520cec | ||
|
|
d68bbe13cb | ||
|
|
db65c15aba | ||
|
|
dd7c2798dc | ||
|
|
3f4babe28b | ||
|
|
d32185545b | ||
|
|
dbdd48e05e | ||
|
|
2c82efe8ca | ||
|
|
c4ac9d0ade | ||
|
|
e5f6b9078e | ||
|
|
2e43bdea3e | ||
|
|
5f3b1410fd | ||
|
|
3a05029032 | ||
|
|
2d4418b905 | ||
|
|
c4809250ca | ||
|
|
56f581b195 | ||
|
|
e88ec329f7 | ||
|
|
b59b5b9ab8 | ||
|
|
93db53b77d | ||
|
|
b15040f1b2 | ||
|
|
408dae699e | ||
|
|
0d820bf585 | ||
|
|
9c577e4d04 | ||
|
|
439478f087 | ||
|
|
882ab89172 | ||
|
|
97dcac413f | ||
|
|
9398dbcbe7 |
@@ -1,6 +1,6 @@
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2011-2017 by the contributors
|
||||
Copyright 2011-2018 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
|
||||
|
||||
114
wp-activate.php
114
wp-activate.php
@@ -18,6 +18,50 @@ if ( !is_multisite() ) {
|
||||
die();
|
||||
}
|
||||
|
||||
$valid_error_codes = array( 'already_active', 'blog_taken' );
|
||||
|
||||
list( $activate_path ) = explode( '?', wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
||||
$activate_cookie = 'wp-activate-' . COOKIEHASH;
|
||||
|
||||
$key = '';
|
||||
$result = null;
|
||||
|
||||
if ( isset( $_GET['key'] ) && isset( $_POST['key'] ) && $_GET['key'] !== $_POST['key'] ) {
|
||||
wp_die( __( 'A key value mismatch has been detected. Please follow the link provided in your activation email.' ), __( 'An error occurred during the activation' ), 400 );
|
||||
} elseif ( ! empty( $_GET['key'] ) ) {
|
||||
$key = $_GET['key'];
|
||||
} elseif ( ! empty( $_POST['key'] ) ) {
|
||||
$key = $_POST['key'];
|
||||
}
|
||||
|
||||
if ( $key ) {
|
||||
$redirect_url = remove_query_arg( 'key' );
|
||||
|
||||
if ( $redirect_url !== remove_query_arg( false ) ) {
|
||||
setcookie( $activate_cookie, $key, 0, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
|
||||
wp_safe_redirect( $redirect_url );
|
||||
exit;
|
||||
} else {
|
||||
$result = wpmu_activate_signup( $key );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $result === null && isset( $_COOKIE[ $activate_cookie ] ) ) {
|
||||
$key = $_COOKIE[ $activate_cookie ];
|
||||
$result = wpmu_activate_signup( $key );
|
||||
setcookie( $activate_cookie, ' ', time() - YEAR_IN_SECONDS, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
|
||||
}
|
||||
|
||||
if ( $result === null || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
|
||||
status_header( 404 );
|
||||
} elseif ( is_wp_error( $result ) ) {
|
||||
$error_code = $result->get_error_code();
|
||||
|
||||
if ( ! in_array( $error_code, $valid_error_codes ) ) {
|
||||
status_header( 400 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_object( $wp_object_cache ) )
|
||||
$wp_object_cache->cache_enabled = false;
|
||||
|
||||
@@ -67,13 +111,14 @@ function wpmu_activate_stylesheet() {
|
||||
<?php
|
||||
}
|
||||
add_action( 'wp_head', 'wpmu_activate_stylesheet' );
|
||||
add_action( 'wp_head', 'wp_sensitive_page_meta' );
|
||||
|
||||
get_header( 'wp-activate' );
|
||||
?>
|
||||
|
||||
<div id="signup-content" class="widecolumn">
|
||||
<div class="wp-activate-container">
|
||||
<?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?>
|
||||
<?php if ( ! $key ) { ?>
|
||||
|
||||
<h2><?php _e('Activation Key Required') ?></h2>
|
||||
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>">
|
||||
@@ -87,43 +132,40 @@ get_header( 'wp-activate' );
|
||||
</form>
|
||||
|
||||
<?php } else {
|
||||
|
||||
$key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
|
||||
$result = wpmu_activate_signup( $key );
|
||||
if ( is_wp_error($result) ) {
|
||||
if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
|
||||
$signup = $result->get_error_data();
|
||||
?>
|
||||
<h2><?php _e('Your account is now active!'); ?></h2>
|
||||
<?php
|
||||
echo '<p class="lead-in">';
|
||||
if ( $signup->domain . $signup->path == '' ) {
|
||||
printf(
|
||||
/* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */
|
||||
__( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
|
||||
network_site_url( 'wp-login.php', 'login' ),
|
||||
$signup->user_login,
|
||||
$signup->user_email,
|
||||
wp_lostpassword_url()
|
||||
);
|
||||
} else {
|
||||
printf(
|
||||
/* translators: 1: site URL, 2: site domain, 3: username, 4: user email, 5: lost password URL */
|
||||
__( 'Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.' ),
|
||||
'http://' . $signup->domain,
|
||||
$signup->domain,
|
||||
$signup->user_login,
|
||||
$signup->user_email,
|
||||
wp_lostpassword_url()
|
||||
);
|
||||
}
|
||||
echo '</p>';
|
||||
if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes ) ) {
|
||||
$signup = $result->get_error_data();
|
||||
?>
|
||||
<h2><?php _e('Your account is now active!'); ?></h2>
|
||||
<?php
|
||||
echo '<p class="lead-in">';
|
||||
if ( $signup->domain . $signup->path == '' ) {
|
||||
printf(
|
||||
/* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */
|
||||
__( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
|
||||
network_site_url( 'wp-login.php', 'login' ),
|
||||
$signup->user_login,
|
||||
$signup->user_email,
|
||||
wp_lostpassword_url()
|
||||
);
|
||||
} else {
|
||||
?>
|
||||
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
|
||||
<p><?php echo $result->get_error_message(); ?></p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: site URL, 2: site domain, 3: username, 4: user email, 5: lost password URL */
|
||||
__( 'Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.' ),
|
||||
'http://' . $signup->domain,
|
||||
$signup->domain,
|
||||
$signup->user_login,
|
||||
$signup->user_email,
|
||||
wp_lostpassword_url()
|
||||
);
|
||||
}
|
||||
echo '</p>';
|
||||
} elseif ( $result === null || is_wp_error( $result ) ) {
|
||||
?>
|
||||
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
|
||||
<?php if ( is_wp_error( $result ) ) : ?>
|
||||
<p><?php echo $result->get_error_message(); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
} else {
|
||||
$url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
|
||||
$user = get_userdata( (int) $result['user_id'] );
|
||||
|
||||
@@ -43,6 +43,184 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.15'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.15' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.14'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.14' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.13'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.13' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.12'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.12' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.11'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.11' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.10'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.10' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.8.9'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.8.9' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: WordPress version number */
|
||||
printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '4.8.8' );
|
||||
?>
|
||||
<?php
|
||||
/* translators: %s: Codex URL */
|
||||
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.8' );
|
||||
?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed one security issue.' ), '4.8.7' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.7' ); ?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '4.8.6' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.6' ); ?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed one security issue.' ), '4.8.5' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.5' ); ?>
|
||||
</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.8.4', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.4' ); ?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed one security issue.' ), '4.8.3' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.3' ); ?>
|
||||
</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.', 5 ), '4.8.2', number_format_i18n( 5 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.2' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 29 ), '4.8.1', number_format_i18n( 29 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.8.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="feature-section one-col">
|
||||
<div class="col">
|
||||
<h2><?php _e( 'An Update with You in Mind' ); ?></h2>
|
||||
@@ -59,11 +237,42 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="col">
|
||||
<picture>
|
||||
<!-- Large image -->
|
||||
<source media="(min-width: 1050px)" srcset="https://cldup.com/-951havc3C.png" />
|
||||
<source media="( min-width: 1050px )"
|
||||
srcset="
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_810.png 810w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_1054.png 1054w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_1266.png 1266w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_1458.png 1458w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_1633.png 1633w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_1797.png 1797w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_1955.png 1955w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-widescreen_w_2100.png 2100w"
|
||||
sizes="( max-width: 1290px ) calc( 100vw - 240px ), 1050px" />
|
||||
<!-- Medium image -->
|
||||
<source media="(min-width: 601px)" srcset="https://cldup.com/60ktdYzv0l.png" />
|
||||
<source media="( min-width: 601px )"
|
||||
srcset="
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_531.png 531w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_745.png 745w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_927.png 927w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_1089.png 1089w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_1236.png 1236w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_1370.png 1370w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_1498.png 1498w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four_w_1620.png 1620w"
|
||||
sizes="( max-width: 782px ) calc( 100vw - 70px ), ( max-width: 960px ) calc( 100vw - 116px ), calc( 100vw - 240px )" />
|
||||
<!-- Small image -->
|
||||
<img src="https://cldup.com/mwvU0Zi5wW.png" alt="" />
|
||||
<img src="https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_685.png"
|
||||
srcset="
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_300.png 300w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_451.png 451w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_575.png 575w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_685.png 685w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_784.png 784w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_873.png 873w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_959.png 959w,
|
||||
https://s.w.org/images/core/4.8/widgets-with-all-four-mobile_w_1040.png 1040w"
|
||||
sizes="( max-width: 500px ) calc( 100vw - 40px ), calc( 100vw - 70px )"
|
||||
alt="" />
|
||||
</picture>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,7 +280,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="feature-section two-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Image Widget' ); ?></h3>
|
||||
<p><?php _e( 'Adding an image to a widget is now a simple task that is achievable for any WordPress user without needing to know code. Simply insert your image right within the widget settings. Try adding something like a headshot or a photo of your latest weekend adventure — and see it appear automatically.' );?></p>
|
||||
<p><?php _e( 'Adding an image to a widget is now a simple task that is achievable for any WordPress user without needing to know code. Simply insert your image right within the widget settings. Try adding something like a headshot or a photo of your latest weekend adventure — and see it appear automatically.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Video Widget' ); ?></h3>
|
||||
@@ -97,8 +306,8 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="col">
|
||||
<?php
|
||||
echo wp_video_shortcode( array(
|
||||
'mp4' => 'https://cldup.com/LHwC1lL_jC.mp4',
|
||||
'poster' => 'https://cldup.com/wx7uMMXJor.png',
|
||||
'mp4' => 'https://s.w.org/images/core/4.8/link-boundaries.mp4',
|
||||
'poster' => 'https://s.w.org/images/core/4.8/link-boundaries.png',
|
||||
'width' => 1140,
|
||||
'height' => 624,
|
||||
// 'class' => 'wp-video-shortcode feature-video',
|
||||
@@ -120,7 +329,23 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<p><?php _e( 'Being part of the community can help you improve your WordPress skills and network with people you wouldn’t otherwise meet. Now you can easily find your local events just by logging in to your dashboard and looking at the new Events and News dashboard widget.' ); ?>
|
||||
</div>
|
||||
<div class="col">
|
||||
<img src="https://cldup.com/GuISab3_X1.png" alt="" />
|
||||
<img
|
||||
src="https://s.w.org/images/core/4.8/events-widget_w_732.png"
|
||||
srcset="
|
||||
https://s.w.org/images/core/4.8/events-widget_w_280.png 280w,
|
||||
https://s.w.org/images/core/4.8/events-widget_w_420.png 420w,
|
||||
https://s.w.org/images/core/4.8/events-widget_w_529.png 529w,
|
||||
https://s.w.org/images/core/4.8/events-widget_w_638.png 638w,
|
||||
https://s.w.org/images/core/4.8/events-widget_w_732.png 732w,
|
||||
https://s.w.org/images/core/4.8/events-widget_w_827.png 827w,
|
||||
https://s.w.org/images/core/4.8/events-widget_w_992.png 992w"
|
||||
sizes="
|
||||
( max-width: 500px ) calc( 100vw - 40px ),
|
||||
( max-width: 782px ) calc( 48vw - 33px ),
|
||||
( max-width: 960px ) calc( 47vw - 54px ),
|
||||
( max-width: 1290px ) calc( 47vw - 112px ),
|
||||
496px"
|
||||
alt="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -75,13 +75,13 @@ wp_enqueue_script( 'svg-painter' );
|
||||
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
|
||||
pagenow = '<?php echo $current_screen->id; ?>',
|
||||
typenow = '<?php echo $current_screen->post_type; ?>',
|
||||
adminpage = '<?php echo $admin_body_class; ?>',
|
||||
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
|
||||
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(document).ready(func);else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
|
||||
pagenow = '<?php echo esc_js( $current_screen->id ); ?>',
|
||||
typenow = '<?php echo esc_js( $current_screen->post_type ); ?>',
|
||||
adminpage = '<?php echo esc_js( $admin_body_class ); ?>',
|
||||
thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>',
|
||||
isRtl = <?php echo (int) is_rtl(); ?>;
|
||||
</script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
|
||||
@@ -32,7 +32,7 @@ if ( ! ( isset( $_REQUEST['action'] ) && 'upload-attachment' == $_REQUEST['actio
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin.php' );
|
||||
|
||||
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
||||
header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
|
||||
|
||||
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
|
||||
include( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.about-wrap .jetpack-video-wrapper {
|
||||
@@ -164,9 +163,21 @@
|
||||
.about-wrap [class$="-col"] {
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-webkit-justify-content: space-between;
|
||||
-moz-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-webkit-align-items: center;
|
||||
-moz-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-flex-wrap: wrap;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@@ -178,6 +189,8 @@
|
||||
.about-wrap [class$="-col"] .col {
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
-moz-box-flex: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@@ -187,6 +200,8 @@
|
||||
}
|
||||
|
||||
.about-wrap .three-col .col {
|
||||
-webkit-align-self: flex-start;
|
||||
-ms-flex-item-align: start;
|
||||
align-self: flex-start;
|
||||
min-width: 31%;
|
||||
max-width: 31%;
|
||||
@@ -294,10 +309,6 @@
|
||||
padding-top: 35px;
|
||||
}
|
||||
|
||||
.about-wrap .headline-feature img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section .media-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
2
wp-admin/css/about-rtl.min.css
vendored
2
wp-admin/css/about-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -40,7 +40,6 @@
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.about-wrap .jetpack-video-wrapper {
|
||||
@@ -164,9 +163,21 @@
|
||||
.about-wrap [class$="-col"] {
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: flex;
|
||||
-webkit-box-pack: justify;
|
||||
-webkit-justify-content: space-between;
|
||||
-moz-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
-webkit-box-align: center;
|
||||
-webkit-align-items: center;
|
||||
-moz-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-flex-wrap: wrap;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@@ -178,6 +189,8 @@
|
||||
.about-wrap [class$="-col"] .col {
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
-moz-box-flex: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@@ -187,6 +200,8 @@
|
||||
}
|
||||
|
||||
.about-wrap .three-col .col {
|
||||
-webkit-align-self: flex-start;
|
||||
-ms-flex-item-align: start;
|
||||
align-self: flex-start;
|
||||
min-width: 31%;
|
||||
max-width: 31%;
|
||||
@@ -294,10 +309,6 @@
|
||||
padding-top: 35px;
|
||||
}
|
||||
|
||||
.about-wrap .headline-feature img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section .media-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
2
wp-admin/css/about.min.css
vendored
2
wp-admin/css/about.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/colors/light/colors-rtl.min.css
vendored
2
wp-admin/css/colors/light/colors-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/colors/light/colors.min.css
vendored
2
wp-admin/css/colors/light/colors.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -334,7 +334,7 @@ form#tags-filter {
|
||||
}
|
||||
|
||||
#content-resize-handle {
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll left bottom;
|
||||
width: 12px;
|
||||
cursor: row-resize;
|
||||
}
|
||||
@@ -1311,7 +1311,7 @@ table.links-table {
|
||||
(min-resolution: 120dpi) {
|
||||
#content-resize-handle,
|
||||
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
||||
background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
|
||||
background: transparent url(../images/resize-2x.gif) no-repeat scroll left bottom;
|
||||
-webkit-background-size: 11px 11px;
|
||||
background-size: 11px 11px;
|
||||
}
|
||||
|
||||
2
wp-admin/css/edit-rtl.min.css
vendored
2
wp-admin/css/edit-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/forms-rtl.min.css
vendored
2
wp-admin/css/forms-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/forms.min.css
vendored
2
wp-admin/css/forms.min.css
vendored
File diff suppressed because one or more lines are too long
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
@@ -1644,6 +1644,8 @@ body.full-overlay-active {
|
||||
min-width: 299px;
|
||||
max-width: 599px;
|
||||
width: 18%;
|
||||
width: -webkit-calc( 18% - 1px );
|
||||
width: calc( 18% - 1px );
|
||||
height: 45px;
|
||||
border-top: 1px solid #ddd;
|
||||
background: #eee;
|
||||
|
||||
2
wp-admin/css/themes-rtl.min.css
vendored
2
wp-admin/css/themes-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1644,6 +1644,8 @@ body.full-overlay-active {
|
||||
min-width: 299px;
|
||||
max-width: 599px;
|
||||
width: 18%;
|
||||
width: -webkit-calc( 18% - 1px );
|
||||
width: calc( 18% - 1px );
|
||||
height: 45px;
|
||||
border-top: 1px solid #ddd;
|
||||
background: #eee;
|
||||
|
||||
2
wp-admin/css/themes.min.css
vendored
2
wp-admin/css/themes.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -619,6 +619,29 @@ div#widgets-right .widget-top:hover,
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
/* =Specific widget styling
|
||||
-------------------------------------------------------------- */
|
||||
.text-widget-fields {
|
||||
position: relative;
|
||||
}
|
||||
.text-widget-fields [hidden] {
|
||||
display: none;
|
||||
}
|
||||
.text-widget-fields .wp-pointer.wp-pointer-top {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
top: 100px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
.text-widget-fields .wp-pointer .wp-pointer-arrow {
|
||||
right: auto;
|
||||
left: 15px;
|
||||
}
|
||||
.text-widget-fields .wp-pointer .wp-pointer-buttons {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
/* =Media Queries
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
|
||||
2
wp-admin/css/widgets-rtl.min.css
vendored
2
wp-admin/css/widgets-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -619,6 +619,29 @@ div#widgets-right .widget-top:hover,
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
/* =Specific widget styling
|
||||
-------------------------------------------------------------- */
|
||||
.text-widget-fields {
|
||||
position: relative;
|
||||
}
|
||||
.text-widget-fields [hidden] {
|
||||
display: none;
|
||||
}
|
||||
.text-widget-fields .wp-pointer.wp-pointer-top {
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
top: 100px;
|
||||
right: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
.text-widget-fields .wp-pointer .wp-pointer-arrow {
|
||||
left: auto;
|
||||
right: 15px;
|
||||
}
|
||||
.text-widget-fields .wp-pointer .wp-pointer-buttons {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
/* =Media Queries
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
|
||||
2
wp-admin/css/widgets.min.css
vendored
2
wp-admin/css/widgets.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -544,6 +544,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) )
|
||||
* @deprecated 3.5.0
|
||||
*/
|
||||
public function wp_set_background_image() {
|
||||
check_ajax_referer( 'custom-background' );
|
||||
if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
|
||||
$attachment_id = absint($_POST['attachment_id']);
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
|
||||
@@ -326,7 +326,7 @@ class Custom_Image_Header {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
(function($){
|
||||
var default_color = '<?php echo $default_color; ?>',
|
||||
var default_color = '<?php echo esc_js( $default_color ); ?>',
|
||||
header_text_fields;
|
||||
|
||||
function pickColor(color) {
|
||||
|
||||
@@ -74,7 +74,7 @@ do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
|
||||
<div id="message" class="updated">
|
||||
<p><strong><?php echo $message; ?></strong></p>
|
||||
<?php if ( $wp_http_referer ) { ?>
|
||||
<p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php
|
||||
<p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>"><?php
|
||||
/* translators: %s: taxonomy name */
|
||||
printf( _x( '← Back to %s', 'admin screen' ), $tax->labels->name );
|
||||
?></a></p>
|
||||
|
||||
@@ -1070,6 +1070,8 @@ function wp_ajax_replyto_comment( $action ) {
|
||||
if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
|
||||
kses_remove_filters(); // start with a clean slate
|
||||
kses_init_filters(); // set up the filters
|
||||
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
|
||||
add_filter( 'pre_comment_content', 'wp_filter_kses' );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -2063,7 +2065,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => __( 'Sorry, you are not allowed to upload files.' ),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -2077,7 +2079,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => __( 'Sorry, you are not allowed to attach files to this post.' ),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -2087,7 +2089,11 @@ function wp_ajax_upload_attachment() {
|
||||
$post_id = null;
|
||||
}
|
||||
|
||||
$post_data = isset( $_REQUEST['post_data'] ) ? $_REQUEST['post_data'] : array();
|
||||
$post_data = ! empty( $_REQUEST['post_data'] ) ? _wp_get_allowed_postdata( _wp_translate_postdata( false, (array) $_REQUEST['post_data'] ) ) : array();
|
||||
|
||||
if ( is_wp_error( $post_data ) ) {
|
||||
wp_die( $post_data->get_error_message() );
|
||||
}
|
||||
|
||||
// If the context is custom header or background, make sure the uploaded file is an image.
|
||||
if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ) ) ) {
|
||||
@@ -2097,7 +2103,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => __( 'The uploaded file is not a valid image. Please try again.' ),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -2112,7 +2118,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => $attachment_id->get_error_message(),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
|
||||
@@ -319,6 +319,11 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
*/
|
||||
protected function extra_tablenav( $which ) {
|
||||
global $comment_status, $comment_type;
|
||||
static $has_items;
|
||||
|
||||
if ( ! isset( $has_items ) ) {
|
||||
$has_items = $this->has_items();
|
||||
}
|
||||
?>
|
||||
<div class="alignleft actions">
|
||||
<?php
|
||||
@@ -354,7 +359,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
|
||||
}
|
||||
|
||||
if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $this->has_items() ) {
|
||||
if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
|
||||
wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
|
||||
$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
|
||||
submit_button( $title, 'apply', 'delete_all', false );
|
||||
|
||||
@@ -601,16 +601,16 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
if ( $is_active ) {
|
||||
if ( current_user_can( 'manage_network_plugins' ) ) {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Deactivate' ) . '</a>';
|
||||
$actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Network Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Deactivate' ) . '</a>';
|
||||
}
|
||||
} else {
|
||||
if ( current_user_can( 'manage_network_plugins' ) ) {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Activate' ) . '</a>';
|
||||
$actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Network Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Network Activate' ) . '</a>';
|
||||
}
|
||||
if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) ) {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -624,14 +624,14 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
);
|
||||
} elseif ( $is_active ) {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
|
||||
$actions['deactivate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
|
||||
} else {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Activate' ) . '</a>';
|
||||
$actions['activate'] = '<a href="' . wp_nonce_url( 'plugins.php?action=activate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( _x( 'Activate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Activate' ) . '</a>';
|
||||
|
||||
if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url( 'plugins.php?action=delete-selected&checked[]=' . urlencode( $plugin_file ) . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins' ) . '" class="delete" aria-label="' . esc_attr( sprintf( _x( 'Delete %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Delete' ) . '</a>';
|
||||
}
|
||||
} // end if $is_active
|
||||
|
||||
@@ -639,7 +639,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can( 'edit_plugins' ) && is_writable( WP_PLUGIN_DIR . '/' . $plugin_file ) ) {
|
||||
/* translators: %s: plugin name */
|
||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" class="edit" aria-label="' . esc_attr( sprintf( __( 'Edit %s' ), $plugin_data['Name'] ) ) . '">' . __( 'Edit' ) . '</a>';
|
||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . urlencode( $plugin_file ) . '" class="edit" aria-label="' . esc_attr( sprintf( __( 'Edit %s' ), $plugin_data['Name'] ) ) . '">' . __( 'Edit' ) . '</a>';
|
||||
}
|
||||
} // end if $context
|
||||
|
||||
|
||||
@@ -290,7 +290,9 @@ final class WP_Screen {
|
||||
|
||||
switch ( $base ) {
|
||||
case 'post' :
|
||||
if ( isset( $_GET['post'] ) )
|
||||
if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] )
|
||||
wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
|
||||
elseif ( isset( $_GET['post'] ) )
|
||||
$post_id = (int) $_GET['post'];
|
||||
elseif ( isset( $_POST['post_ID'] ) )
|
||||
$post_id = (int) $_POST['post_ID'];
|
||||
|
||||
@@ -647,6 +647,10 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
||||
if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Skip the OS X-created __MACOSX directory
|
||||
continue;
|
||||
|
||||
if ( 0 !== validate_file( $info['name'] ) ) {
|
||||
return new WP_Error( 'invalid_file_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );
|
||||
}
|
||||
|
||||
$uncompressed_size += $info['size'];
|
||||
|
||||
if ( '/' === substr( $info['name'], -1 ) ) {
|
||||
@@ -807,6 +811,10 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
||||
if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files
|
||||
continue;
|
||||
|
||||
if ( 0 !== validate_file( $file['filename'] ) ) {
|
||||
return new WP_Error( 'invalid_file_pclzip', __( 'Could not extract file from archive.' ), $file['filename'] );
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE) )
|
||||
return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ wp_enqueue_style( 'ie' );
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
|
||||
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
|
||||
isRtl = <?php echo (int) is_rtl(); ?>;
|
||||
</script>
|
||||
<?php
|
||||
@@ -2829,8 +2829,11 @@ function edit_form_image_editor( $post ) {
|
||||
<label for="attachment_content"><strong><?php _e( 'Description' ); ?></strong><?php
|
||||
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
|
||||
echo ': ' . __( 'Displayed on attachment pages.' );
|
||||
} ?></label>
|
||||
<?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?>
|
||||
}
|
||||
|
||||
?>
|
||||
</label>
|
||||
<?php wp_editor( format_to_edit( $post->post_content ), 'attachment_content', $editor_args ); ?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -436,24 +436,48 @@ function set_screen_options() {
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
$screen_option = false;
|
||||
|
||||
if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
|
||||
/**
|
||||
* Filters a screen option value before it is set.
|
||||
*
|
||||
* The filter can also be used to modify non-standard [items]_per_page
|
||||
* settings. See the parent function for a full list of standard options.
|
||||
*
|
||||
* Returning false to the filter will skip saving the current option.
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @since 5.4.2 Only applied to options ending with '_page',
|
||||
* or the 'layout_columns' option.
|
||||
*
|
||||
* @see set_screen_options()
|
||||
*
|
||||
* @param mixed $screen_option The value to save instead of the option value.
|
||||
* Default false (to skip saving the current option).
|
||||
* @param string $option The option name.
|
||||
* @param int $value The option value.
|
||||
*/
|
||||
$screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a screen option value before it is set.
|
||||
*
|
||||
* The filter can also be used to modify non-standard [items]_per_page
|
||||
* settings. See the parent function for a full list of standard options.
|
||||
* The dynamic portion of the hook, `$option`, refers to the option name.
|
||||
*
|
||||
* Returning false to the filter will skip saving the current option.
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @since 5.4.2
|
||||
*
|
||||
* @see set_screen_options()
|
||||
*
|
||||
* @param bool|int $value Screen option value. Default false to skip.
|
||||
* @param string $option The option name.
|
||||
* @param int $value The number of rows to use.
|
||||
* @param mixed $screen_option The value to save instead of the option value.
|
||||
* Default false (to skip saving the current option).
|
||||
* @param string $option The option name.
|
||||
* @param int $value The option value.
|
||||
*/
|
||||
$value = apply_filters( 'set-screen-option', false, $option, $value );
|
||||
$value = apply_filters( "set_screen_option_{$option}", $screen_option, $option, $value );
|
||||
|
||||
if ( false === $value )
|
||||
return;
|
||||
|
||||
@@ -922,7 +922,7 @@ function can_edit_network( $site_id ) {
|
||||
function _thickbox_path_admin_subfolder() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var tb_pathToImage = "<?php echo includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ); ?>";
|
||||
var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ) ); ?>";
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -100,8 +100,8 @@ jQuery(document).ready(function() {
|
||||
return;
|
||||
jQuery('#permalink_structure').val( this.value );
|
||||
});
|
||||
jQuery('#permalink_structure').focus(function() {
|
||||
jQuery("#custom_selection").attr('checked', 'checked');
|
||||
jQuery( '#permalink_structure' ).on( 'click input', function() {
|
||||
jQuery( '#custom_selection' ).prop( 'checked', true );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -175,6 +175,27 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
return $post_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns only allowed post data fields
|
||||
*
|
||||
* @since 4.9.9
|
||||
*
|
||||
* @param array $post_data Array of post data. Defaults to the contents of $_POST.
|
||||
* @return object|bool WP_Error on failure, true on success.
|
||||
*/
|
||||
function _wp_get_allowed_postdata( $post_data = null ) {
|
||||
if ( empty( $post_data ) ) {
|
||||
$post_data = $_POST;
|
||||
}
|
||||
|
||||
// Pass through errors
|
||||
if ( is_wp_error( $post_data ) ) {
|
||||
return $post_data;
|
||||
}
|
||||
|
||||
return array_diff_key( $post_data, array_flip( array( 'meta_input', 'file', 'guid' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing post with values provided in $_POST.
|
||||
*
|
||||
@@ -243,6 +264,7 @@ function edit_post( $post_data = null ) {
|
||||
$post_data = _wp_translate_postdata( true, $post_data );
|
||||
if ( is_wp_error($post_data) )
|
||||
wp_die( $post_data->get_error_message() );
|
||||
$translated = _wp_get_allowed_postdata( $post_data );
|
||||
|
||||
// Post Formats
|
||||
if ( isset( $post_data['post_format'] ) )
|
||||
@@ -322,7 +344,7 @@ function edit_post( $post_data = null ) {
|
||||
$attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();
|
||||
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
$post_data = apply_filters( 'attachment_fields_to_save', $post_data, $attachment_data );
|
||||
$translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );
|
||||
}
|
||||
|
||||
// Convert taxonomy input to term IDs, to avoid ambiguity.
|
||||
@@ -367,7 +389,7 @@ function edit_post( $post_data = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_data['tax_input'][ $taxonomy ] = $clean_terms;
|
||||
$translated['tax_input'][ $taxonomy ] = $clean_terms;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,18 +397,18 @@ function edit_post( $post_data = null ) {
|
||||
|
||||
update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
|
||||
|
||||
$success = wp_update_post( $post_data );
|
||||
$success = wp_update_post( $translated );
|
||||
// If the save failed, see if we can sanity check the main fields and try again
|
||||
if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) {
|
||||
$fields = array( 'post_title', 'post_content', 'post_excerpt' );
|
||||
|
||||
foreach ( $fields as $field ) {
|
||||
if ( isset( $post_data[ $field ] ) ) {
|
||||
$post_data[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $post_data[ $field ] );
|
||||
if ( isset( $translated[ $field ] ) ) {
|
||||
$translated[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $translated[ $field ] );
|
||||
}
|
||||
}
|
||||
|
||||
wp_update_post( $post_data );
|
||||
wp_update_post( $translated );
|
||||
}
|
||||
|
||||
// Now that we have an ID we can fix any attachment anchor hrefs
|
||||
@@ -546,9 +568,9 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
unset( $post_data['tax_input']['category'] );
|
||||
}
|
||||
|
||||
$post_data['post_ID'] = $post_ID;
|
||||
$post_data['post_type'] = $post->post_type;
|
||||
$post_data['post_mime_type'] = $post->post_mime_type;
|
||||
$post_data['guid'] = $post->guid;
|
||||
|
||||
foreach ( array( 'comment_status', 'ping_status', 'post_author' ) as $field ) {
|
||||
if ( ! isset( $post_data[ $field ] ) ) {
|
||||
@@ -556,14 +578,12 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_data['ID'] = $post_ID;
|
||||
$post_data['post_ID'] = $post_ID;
|
||||
|
||||
$post_data = _wp_translate_postdata( true, $post_data );
|
||||
if ( is_wp_error( $post_data ) ) {
|
||||
$skipped[] = $post_ID;
|
||||
continue;
|
||||
}
|
||||
$post_data = _wp_get_allowed_postdata( $post_data );
|
||||
|
||||
$updated[] = wp_update_post( $post_data );
|
||||
|
||||
@@ -574,8 +594,8 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
unstick_post( $post_ID );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_format'] ) )
|
||||
set_post_format( $post_ID, $post_data['post_format'] );
|
||||
if ( isset( $shared_post_data['post_format'] ) )
|
||||
set_post_format( $post_ID, $shared_post_data['post_format'] );
|
||||
}
|
||||
|
||||
return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked );
|
||||
@@ -756,9 +776,10 @@ function wp_write_post() {
|
||||
$translated = _wp_translate_postdata( false );
|
||||
if ( is_wp_error($translated) )
|
||||
return $translated;
|
||||
$translated = _wp_get_allowed_postdata( $translated );
|
||||
|
||||
// Create the post.
|
||||
$post_ID = wp_insert_post( $_POST );
|
||||
$post_ID = wp_insert_post( $translated );
|
||||
if ( is_wp_error( $post_ID ) )
|
||||
return $post_ID;
|
||||
|
||||
@@ -1678,6 +1699,7 @@ function wp_create_post_autosave( $post_data ) {
|
||||
$post_data = _wp_translate_postdata( true, $post_data );
|
||||
if ( is_wp_error( $post_data ) )
|
||||
return $post_data;
|
||||
$post_data = _wp_get_allowed_postdata( $post_data );
|
||||
|
||||
$post_author = get_current_user_id();
|
||||
|
||||
|
||||
@@ -772,7 +772,7 @@ function page_template_dropdown( $default = '', $post_type = 'page' ) {
|
||||
ksort( $templates );
|
||||
foreach ( array_keys( $templates ) as $template ) {
|
||||
$selected = selected( $default, $templates[ $template ], false );
|
||||
echo "\n\t<option value='" . $templates[ $template ] . "' $selected>$template</option>";
|
||||
echo "\n\t<option value='" . esc_attr( $templates[ $template ] ) . "' $selected>" . esc_html( $template ) . "</option>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1617,12 +1617,12 @@ wp_enqueue_style( 'colors' );
|
||||
<script type="text/javascript">
|
||||
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
|
||||
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
|
||||
pagenow = '<?php echo $current_screen->id; ?>',
|
||||
typenow = '<?php echo $current_screen->post_type; ?>',
|
||||
adminpage = '<?php echo $admin_body_class; ?>',
|
||||
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
|
||||
var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>',
|
||||
pagenow = '<?php echo esc_js( $current_screen->id ); ?>',
|
||||
typenow = '<?php echo esc_js( $current_screen->post_type ); ?>',
|
||||
adminpage = '<?php echo esc_js( $admin_body_class ); ?>',
|
||||
thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>',
|
||||
isRtl = <?php echo (int) is_rtl(); ?>;
|
||||
</script>
|
||||
<?php
|
||||
|
||||
@@ -706,11 +706,15 @@ $_old_files = array(
|
||||
// 4.6
|
||||
'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
|
||||
// 4.8
|
||||
'wp-includes/js/tinymce/plugins/wpembed',
|
||||
'wp-includes/js/tinymce/plugins/media/moxieplayer.swf',
|
||||
'wp-includes/js/tinymce/skins/lightgray/fonts/readme.md',
|
||||
'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce-small.json',
|
||||
'wp-includes/js/tinymce/skins/lightgray/fonts/tinymce.json',
|
||||
'wp-includes/js/tinymce/skins/lightgray/skin.ie7.min.css',
|
||||
// 4.9.2
|
||||
'wp-includes/js/mediaelement/flashmediaelement.swf',
|
||||
'wp-includes/js/mediaelement/silverlightmediaelement.xap',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -1086,7 +1090,11 @@ function update_core($from, $to) {
|
||||
$old_file = $to . $old_file;
|
||||
if ( !$wp_filesystem->exists($old_file) )
|
||||
continue;
|
||||
$wp_filesystem->delete($old_file, true);
|
||||
|
||||
// If the file isn't deleted, try writing an empty string to the file instead.
|
||||
if ( ! $wp_filesystem->delete( $old_file, true ) && $wp_filesystem->is_file( $old_file ) ) {
|
||||
$wp_filesystem->put_contents( $old_file, '' );
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any Genericons example.html's from the filesystem
|
||||
|
||||
@@ -279,7 +279,7 @@ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
|
||||
*/
|
||||
$language = '';
|
||||
if ( ! empty( $_REQUEST['language'] ) ) {
|
||||
$language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );
|
||||
$language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );
|
||||
} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
|
||||
$language = $GLOBALS['wp_local_package'];
|
||||
}
|
||||
|
||||
@@ -64,11 +64,13 @@
|
||||
frame.on( 'select', function() {
|
||||
// Grab the selected attachment.
|
||||
var attachment = frame.state().get('selection').first();
|
||||
var nonceValue = $( '#_wpnonce' ).val() || '';
|
||||
|
||||
// Run an AJAX request to set the background image.
|
||||
$.post( ajaxurl, {
|
||||
action: 'set-background-image',
|
||||
attachment_id: attachment.id,
|
||||
_ajax_nonce: nonceValue,
|
||||
size: 'full'
|
||||
}).done( function() {
|
||||
// When the request completes, reload the window.
|
||||
|
||||
2
wp-admin/js/custom-background.min.js
vendored
2
wp-admin/js/custom-background.min.js
vendored
@@ -1 +1 @@
|
||||
!function(a){a(document).ready(function(){var b,c=a("#custom-background-image");a("#background-color").wpColorPicker({change:function(a,b){c.css("background-color",b.color.toString())},clear:function(){c.css("background-color","")}}),a('select[name="background-size"]').change(function(){c.css("background-size",a(this).val())}),a('input[name="background-position"]').change(function(){c.css("background-position",a(this).val())}),a('input[name="background-repeat"]').change(function(){c.css("background-repeat",a(this).is(":checked")?"repeat":"no-repeat")}),a('input[name="background-attachment"]').change(function(){c.css("background-attachment",a(this).is(":checked")?"scroll":"fixed")}),a("#choose-from-library-link").click(function(c){var d=a(this);return c.preventDefault(),b?void b.open():(b=wp.media.frames.customBackground=wp.media({title:d.data("choose"),library:{type:"image"},button:{text:d.data("update"),close:!1}}),b.on("select",function(){var c=b.state().get("selection").first();a.post(ajaxurl,{action:"set-background-image",attachment_id:c.id,size:"full"}).done(function(){window.location.reload()})}),void b.open())})})}(jQuery);
|
||||
!function(a){a(document).ready(function(){var b,c=a("#custom-background-image");a("#background-color").wpColorPicker({change:function(a,b){c.css("background-color",b.color.toString())},clear:function(){c.css("background-color","")}}),a('select[name="background-size"]').change(function(){c.css("background-size",a(this).val())}),a('input[name="background-position"]').change(function(){c.css("background-position",a(this).val())}),a('input[name="background-repeat"]').change(function(){c.css("background-repeat",a(this).is(":checked")?"repeat":"no-repeat")}),a('input[name="background-attachment"]').change(function(){c.css("background-attachment",a(this).is(":checked")?"scroll":"fixed")}),a("#choose-from-library-link").click(function(c){var d=a(this);return c.preventDefault(),b?void b.open():(b=wp.media.frames.customBackground=wp.media({title:d.data("choose"),library:{type:"image"},button:{text:d.data("update"),close:!1}}),b.on("select",function(){var c=b.state().get("selection").first(),d=a("#_wpnonce").val()||"";a.post(ajaxurl,{action:"set-background-image",attachment_id:c.id,_ajax_nonce:d,size:"full"}).done(function(){window.location.reload()})}),void b.open())})})}(jQuery);
|
||||
@@ -5507,6 +5507,13 @@
|
||||
} );
|
||||
} ());
|
||||
|
||||
// Make sure TinyMCE dialogs appear above Customizer UI.
|
||||
$( document ).one( 'wp-before-tinymce-init', function() {
|
||||
if ( ! window.tinymce.ui.FloatPanel.zIndex || window.tinymce.ui.FloatPanel.zIndex < 500001 ) {
|
||||
window.tinymce.ui.FloatPanel.zIndex = 500001;
|
||||
}
|
||||
} );
|
||||
|
||||
api.trigger( 'ready' );
|
||||
});
|
||||
|
||||
|
||||
2
wp-admin/js/customize-controls.min.js
vendored
2
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -2229,8 +2229,7 @@
|
||||
}
|
||||
} );
|
||||
|
||||
control.container.find( '.menu-delete-item' ).on( 'click', function( event ) {
|
||||
event.stopPropagation();
|
||||
control.container.find( '.menu-delete-item .button-link-delete' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
control.setting.set( false );
|
||||
});
|
||||
|
||||
2
wp-admin/js/customize-nav-menus.min.js
vendored
2
wp-admin/js/customize-nav-menus.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@ jQuery(function($) {
|
||||
* Adds a click event handler to the element with a 'wp-gallery' class.
|
||||
*/
|
||||
$( 'body' ).bind( 'click.wp-gallery', function(e) {
|
||||
var target = $( e.target ), id, img_size;
|
||||
var target = $( e.target ), id, img_size, nonceValue;
|
||||
|
||||
if ( target.hasClass( 'wp-set-header' ) ) {
|
||||
// Opens the image to preview it full size.
|
||||
@@ -19,6 +19,7 @@ jQuery(function($) {
|
||||
// Sets the image as background of the theme.
|
||||
id = target.data( 'attachment-id' );
|
||||
img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
|
||||
nonceValue = $( '#_wpnonce' ).val() && '';
|
||||
|
||||
/**
|
||||
* This AJAX action has been deprecated since 3.5.0, see custom-background.php
|
||||
@@ -26,6 +27,7 @@ jQuery(function($) {
|
||||
jQuery.post(ajaxurl, {
|
||||
action: 'set-background-image',
|
||||
attachment_id: id,
|
||||
_ajax_nonce: nonceValue,
|
||||
size: img_size
|
||||
}, function() {
|
||||
var win = window.dialogArguments || opener || parent || top;
|
||||
|
||||
2
wp-admin/js/media-gallery.min.js
vendored
2
wp-admin/js/media-gallery.min.js
vendored
@@ -1 +1 @@
|
||||
jQuery(function(a){a("body").bind("click.wp-gallery",function(b){var c,d,e=a(b.target);e.hasClass("wp-set-header")?((window.dialogArguments||opener||parent||top).location.href=e.data("location"),b.preventDefault()):e.hasClass("wp-set-background")&&(c=e.data("attachment-id"),d=a('input[name="attachments['+c+'][image-size]"]:checked').val(),jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:c,size:d},function(){var a=window.dialogArguments||opener||parent||top;a.tb_remove(),a.location.reload()}),b.preventDefault())})});
|
||||
jQuery(function(a){a("body").bind("click.wp-gallery",function(b){var c,d,e,f=a(b.target);f.hasClass("wp-set-header")?((window.dialogArguments||opener||parent||top).location.href=f.data("location"),b.preventDefault()):f.hasClass("wp-set-background")&&(c=f.data("attachment-id"),d=a('input[name="attachments['+c+'][image-size]"]:checked').val(),e=a("#_wpnonce").val()&&"",jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:c,_ajax_nonce:e,size:d},function(){var a=window.dialogArguments||opener||parent||top;a.tb_remove(),a.location.reload()}),b.preventDefault())})});
|
||||
@@ -184,6 +184,12 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If video, test for Vimeo and YouTube, otherwise, renderFail(). This should be removed once #34115 is resolved.
|
||||
if ( 'video' === this.controller.options.mimeType && ! /vimeo|youtu\.?be/.test( urlParser.host ) ) {
|
||||
embedLinkView.renderFail();
|
||||
return;
|
||||
}
|
||||
|
||||
embedLinkView.dfd = $.ajax({
|
||||
url: wp.media.view.settings.oEmbedProxyUrl,
|
||||
data: {
|
||||
@@ -429,7 +435,8 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
*
|
||||
* @param {Object} options - Options.
|
||||
* @param {Backbone.Model} options.model - Model.
|
||||
* @param {jQuery} options.el - Control container element.
|
||||
* @param {jQuery} options.el - Control field container element.
|
||||
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
|
||||
* @returns {void}
|
||||
*/
|
||||
initialize: function initialize( options ) {
|
||||
@@ -437,12 +444,19 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
|
||||
Backbone.View.prototype.initialize.call( control, options );
|
||||
|
||||
if ( ! control.el ) {
|
||||
throw new Error( 'Missing options.el' );
|
||||
}
|
||||
if ( ! ( control.model instanceof component.MediaWidgetModel ) ) {
|
||||
throw new Error( 'Missing options.model' );
|
||||
}
|
||||
if ( ! options.el ) {
|
||||
throw new Error( 'Missing options.el' );
|
||||
}
|
||||
if ( ! options.syncContainer ) {
|
||||
throw new Error( 'Missing options.syncContainer' );
|
||||
}
|
||||
|
||||
control.syncContainer = options.syncContainer;
|
||||
|
||||
control.$el.addClass( 'media-widget-control' );
|
||||
|
||||
// Allow methods to be passed in with control context preserved.
|
||||
_.bindAll( control, 'syncModelToInputs', 'render', 'updateSelectedAttachment', 'renderPreview' );
|
||||
@@ -547,7 +561,7 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
*/
|
||||
syncModelToInputs: function syncModelToInputs() {
|
||||
var control = this;
|
||||
control.$el.next( '.widget-content' ).find( '.media-widget-instance-property' ).each( function() {
|
||||
control.syncContainer.find( '.media-widget-instance-property' ).each( function() {
|
||||
var input = $( this ), value;
|
||||
value = control.model.get( input.data( 'property' ) );
|
||||
if ( _.isUndefined( value ) ) {
|
||||
@@ -1003,9 +1017,8 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
* @returns {void}
|
||||
*/
|
||||
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
|
||||
var widgetContent, controlContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, widgetInside, animatedCheckDelay = 50, renderWhenAnimationDone;
|
||||
var fieldContainer, syncContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, widgetInside, animatedCheckDelay = 50, renderWhenAnimationDone;
|
||||
widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
|
||||
widgetContent = widgetForm.find( '> .widget-content' );
|
||||
idBase = widgetForm.find( '> .id_base' ).val();
|
||||
widgetId = widgetForm.find( '> .widget-id' ).val();
|
||||
|
||||
@@ -1032,8 +1045,9 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
* components", the JS template is rendered outside of the normal form
|
||||
* container.
|
||||
*/
|
||||
controlContainer = $( '<div class="media-widget-control"></div>' );
|
||||
widgetContent.before( controlContainer );
|
||||
fieldContainer = $( '<div></div>' );
|
||||
syncContainer = widgetContainer.find( '.widget-content:first' );
|
||||
syncContainer.before( fieldContainer );
|
||||
|
||||
/*
|
||||
* Sync the widget instance model attributes onto the hidden inputs that widgets currently use to store the state.
|
||||
@@ -1041,7 +1055,7 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
* from the start, without having to sync with hidden fields. See <https://core.trac.wordpress.org/ticket/33507>.
|
||||
*/
|
||||
modelAttributes = {};
|
||||
widgetContent.find( '.media-widget-instance-property' ).each( function() {
|
||||
syncContainer.find( '.media-widget-instance-property' ).each( function() {
|
||||
var input = $( this );
|
||||
modelAttributes[ input.data( 'property' ) ] = input.val();
|
||||
});
|
||||
@@ -1050,7 +1064,8 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
widgetModel = new ModelConstructor( modelAttributes );
|
||||
|
||||
widgetControl = new ControlConstructor({
|
||||
el: controlContainer,
|
||||
el: fieldContainer,
|
||||
syncContainer: syncContainer,
|
||||
model: widgetModel
|
||||
});
|
||||
|
||||
@@ -1078,6 +1093,51 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
component.widgetControls[ widgetModel.get( 'widget_id' ) ] = widgetControl;
|
||||
};
|
||||
|
||||
/**
|
||||
* Setup widget in accessibility mode.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
component.setupAccessibleMode = function setupAccessibleMode() {
|
||||
var widgetForm, widgetId, idBase, widgetControl, ControlConstructor, ModelConstructor, modelAttributes, fieldContainer, syncContainer;
|
||||
widgetForm = $( '.editwidget > form' );
|
||||
if ( 0 === widgetForm.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val();
|
||||
|
||||
ControlConstructor = component.controlConstructors[ idBase ];
|
||||
if ( ! ControlConstructor ) {
|
||||
return;
|
||||
}
|
||||
|
||||
widgetId = widgetForm.find( '> .widget-control-actions > .widget-id' ).val();
|
||||
|
||||
ModelConstructor = component.modelConstructors[ idBase ] || component.MediaWidgetModel;
|
||||
fieldContainer = $( '<div></div>' );
|
||||
syncContainer = widgetForm.find( '> .widget-inside' );
|
||||
syncContainer.before( fieldContainer );
|
||||
|
||||
modelAttributes = {};
|
||||
syncContainer.find( '.media-widget-instance-property' ).each( function() {
|
||||
var input = $( this );
|
||||
modelAttributes[ input.data( 'property' ) ] = input.val();
|
||||
});
|
||||
modelAttributes.widget_id = widgetId;
|
||||
|
||||
widgetControl = new ControlConstructor({
|
||||
el: fieldContainer,
|
||||
syncContainer: syncContainer,
|
||||
model: new ModelConstructor( modelAttributes )
|
||||
});
|
||||
|
||||
component.modelCollection.add( [ widgetControl.model ] );
|
||||
component.widgetControls[ widgetControl.model.get( 'widget_id' ) ] = widgetControl;
|
||||
|
||||
widgetControl.render();
|
||||
};
|
||||
|
||||
/**
|
||||
* Sync widget instance data sanitized from server back onto widget model.
|
||||
*
|
||||
@@ -1146,6 +1206,11 @@ wp.mediaWidgets = ( function( $ ) {
|
||||
var widgetContainer = $( this );
|
||||
component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer );
|
||||
});
|
||||
|
||||
// Accessibility mode.
|
||||
$( window ).on( 'load', function() {
|
||||
component.setupAccessibleMode();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
2
wp-admin/js/widgets/media-widgets.min.js
vendored
2
wp-admin/js/widgets/media-widgets.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -3,7 +3,9 @@
|
||||
wp.textWidgets = ( function( $ ) {
|
||||
'use strict';
|
||||
|
||||
var component = {};
|
||||
var component = {
|
||||
dismissedPointers: []
|
||||
};
|
||||
|
||||
/**
|
||||
* Text widget control.
|
||||
@@ -24,9 +26,9 @@ wp.textWidgets = ( function( $ ) {
|
||||
/**
|
||||
* Initialize.
|
||||
*
|
||||
* @param {Object} options - Options.
|
||||
* @param {Backbone.Model} options.model - Model.
|
||||
* @param {jQuery} options.el - Control container element.
|
||||
* @param {Object} options - Options.
|
||||
* @param {jQuery} options.el - Control field container element.
|
||||
* @param {jQuery} options.syncContainer - Container element where fields are synced for the server.
|
||||
* @returns {void}
|
||||
*/
|
||||
initialize: function initialize( options ) {
|
||||
@@ -35,42 +37,97 @@ wp.textWidgets = ( function( $ ) {
|
||||
if ( ! options.el ) {
|
||||
throw new Error( 'Missing options.el' );
|
||||
}
|
||||
if ( ! options.syncContainer ) {
|
||||
throw new Error( 'Missing options.syncContainer' );
|
||||
}
|
||||
|
||||
Backbone.View.prototype.initialize.call( control, options );
|
||||
control.syncContainer = options.syncContainer;
|
||||
|
||||
/*
|
||||
* Create a container element for the widget control fields.
|
||||
* This is inserted into the DOM immediately before the the .widget-content
|
||||
* element because the contents of this element are essentially "managed"
|
||||
* by PHP, where each widget update cause the entire element to be emptied
|
||||
* and replaced with the rendered output of WP_Widget::form() which is
|
||||
* sent back in Ajax request made to save/update the widget instance.
|
||||
* To prevent a "flash of replaced DOM elements and re-initialized JS
|
||||
* components", the JS template is rendered outside of the normal form
|
||||
* container.
|
||||
*/
|
||||
control.fieldContainer = $( '<div class="text-widget-fields"></div>' );
|
||||
control.fieldContainer.html( wp.template( 'widget-text-control-fields' ) );
|
||||
control.widgetContentContainer = control.$el.find( '.widget-content:first' );
|
||||
control.widgetContentContainer.before( control.fieldContainer );
|
||||
control.$el.addClass( 'text-widget-fields' );
|
||||
control.$el.html( wp.template( 'widget-text-control-fields' ) );
|
||||
|
||||
control.customHtmlWidgetPointer = control.$el.find( '.wp-pointer.custom-html-widget-pointer' );
|
||||
if ( control.customHtmlWidgetPointer.length ) {
|
||||
control.customHtmlWidgetPointer.find( '.close' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
control.customHtmlWidgetPointer.hide();
|
||||
$( '#' + control.fields.text.attr( 'id' ) + '-html' ).focus();
|
||||
control.dismissPointers( [ 'text_widget_custom_html' ] );
|
||||
});
|
||||
control.customHtmlWidgetPointer.find( '.add-widget' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
control.customHtmlWidgetPointer.hide();
|
||||
control.openAvailableWidgetsPanel();
|
||||
});
|
||||
}
|
||||
|
||||
control.pasteHtmlPointer = control.$el.find( '.wp-pointer.paste-html-pointer' );
|
||||
if ( control.pasteHtmlPointer.length ) {
|
||||
control.pasteHtmlPointer.find( '.close' ).on( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
control.pasteHtmlPointer.hide();
|
||||
control.editor.focus();
|
||||
control.dismissPointers( [ 'text_widget_custom_html', 'text_widget_paste_html' ] );
|
||||
});
|
||||
}
|
||||
|
||||
control.fields = {
|
||||
title: control.fieldContainer.find( '.title' ),
|
||||
text: control.fieldContainer.find( '.text' )
|
||||
title: control.$el.find( '.title' ),
|
||||
text: control.$el.find( '.text' )
|
||||
};
|
||||
|
||||
// Sync input fields to hidden sync fields which actually get sent to the server.
|
||||
_.each( control.fields, function( fieldInput, fieldName ) {
|
||||
fieldInput.on( 'input change', function updateSyncField() {
|
||||
var syncInput = control.widgetContentContainer.find( 'input[type=hidden].' + fieldName );
|
||||
if ( syncInput.val() !== $( this ).val() ) {
|
||||
syncInput.val( $( this ).val() );
|
||||
var syncInput = control.syncContainer.find( '.sync-input.' + fieldName );
|
||||
if ( syncInput.val() !== fieldInput.val() ) {
|
||||
syncInput.val( fieldInput.val() );
|
||||
syncInput.trigger( 'change' );
|
||||
}
|
||||
});
|
||||
|
||||
// Note that syncInput cannot be re-used because it will be destroyed with each widget-updated event.
|
||||
fieldInput.val( control.widgetContentContainer.find( 'input[type=hidden].' + fieldName ).val() );
|
||||
fieldInput.val( control.syncContainer.find( '.sync-input.' + fieldName ).val() );
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Dismiss pointers for Custom HTML widget.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*
|
||||
* @param {Array} pointers Pointer IDs to dismiss.
|
||||
* @returns {void}
|
||||
*/
|
||||
dismissPointers: function dismissPointers( pointers ) {
|
||||
_.each( pointers, function( pointer ) {
|
||||
wp.ajax.post( 'dismiss-wp-pointer', {
|
||||
pointer: pointer
|
||||
});
|
||||
component.dismissedPointers.push( pointer );
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Open available widgets panel.
|
||||
*
|
||||
* @since 4.8.1
|
||||
* @returns {void}
|
||||
*/
|
||||
openAvailableWidgetsPanel: function openAvailableWidgetsPanel() {
|
||||
var sidebarControl;
|
||||
wp.customize.section.each( function( section ) {
|
||||
if ( section.extended( wp.customize.Widgets.SidebarSection ) && section.expanded() ) {
|
||||
sidebarControl = wp.customize.control( 'sidebars_widgets[' + section.params.sidebarId + ']' );
|
||||
}
|
||||
});
|
||||
if ( ! sidebarControl ) {
|
||||
return;
|
||||
}
|
||||
setTimeout( function() { // Timeout to prevent click event from causing panel to immediately collapse.
|
||||
wp.customize.Widgets.availableWidgetsPanel.open( sidebarControl );
|
||||
wp.customize.Widgets.availableWidgetsPanel.$search.val( 'HTML' ).trigger( 'keyup' );
|
||||
});
|
||||
},
|
||||
|
||||
@@ -87,11 +144,11 @@ wp.textWidgets = ( function( $ ) {
|
||||
var control = this, syncInput;
|
||||
|
||||
if ( ! control.fields.title.is( document.activeElement ) ) {
|
||||
syncInput = control.widgetContentContainer.find( 'input[type=hidden].title' );
|
||||
syncInput = control.syncContainer.find( '.sync-input.title' );
|
||||
control.fields.title.val( syncInput.val() );
|
||||
}
|
||||
|
||||
syncInput = control.widgetContentContainer.find( 'input[type=hidden].text' );
|
||||
syncInput = control.syncContainer.find( '.sync-input.text' );
|
||||
if ( control.fields.text.is( ':visible' ) ) {
|
||||
if ( ! control.fields.text.is( document.activeElement ) ) {
|
||||
control.fields.text.val( syncInput.val() );
|
||||
@@ -107,23 +164,77 @@ wp.textWidgets = ( function( $ ) {
|
||||
* @returns {void}
|
||||
*/
|
||||
initializeEditor: function initializeEditor() {
|
||||
var control = this, changeDebounceDelay = 1000, id, textarea, restoreTextMode = false;
|
||||
var control = this, changeDebounceDelay = 1000, id, textarea, triggerChangeIfDirty, restoreTextMode = false, needsTextareaChangeTrigger = false;
|
||||
textarea = control.fields.text;
|
||||
id = textarea.attr( 'id' );
|
||||
|
||||
/**
|
||||
* Trigger change if dirty.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
triggerChangeIfDirty = function() {
|
||||
var updateWidgetBuffer = 300; // See wp.customize.Widgets.WidgetControl._setupUpdateUI() which uses 250ms for updateWidgetDebounced.
|
||||
if ( control.editor.isDirty() ) {
|
||||
|
||||
/*
|
||||
* Account for race condition in customizer where user clicks Save & Publish while
|
||||
* focus was just previously given to to the editor. Since updates to the editor
|
||||
* are debounced at 1 second and since widget input changes are only synced to
|
||||
* settings after 250ms, the customizer needs to be put into the processing
|
||||
* state during the time between the change event is triggered and updateWidget
|
||||
* logic starts. Note that the debounced update-widget request should be able
|
||||
* to be removed with the removal of the update-widget request entirely once
|
||||
* widgets are able to mutate their own instance props directly in JS without
|
||||
* having to make server round-trips to call the respective WP_Widget::update()
|
||||
* callbacks. See <https://core.trac.wordpress.org/ticket/33507>.
|
||||
*/
|
||||
if ( wp.customize && wp.customize.state ) {
|
||||
wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() + 1 );
|
||||
_.delay( function() {
|
||||
wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() - 1 );
|
||||
}, updateWidgetBuffer );
|
||||
}
|
||||
|
||||
if ( ! control.editor.isHidden() ) {
|
||||
control.editor.save();
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger change on textarea when it is dirty for sake of widgets in the Customizer needing to sync form inputs to setting models.
|
||||
if ( needsTextareaChangeTrigger ) {
|
||||
textarea.trigger( 'change' );
|
||||
needsTextareaChangeTrigger = false;
|
||||
}
|
||||
};
|
||||
|
||||
// Just-in-time force-update the hidden input fields.
|
||||
control.syncContainer.closest( '.widget' ).find( '[name=savewidget]:first' ).on( 'click', function onClickSaveButton() {
|
||||
triggerChangeIfDirty();
|
||||
});
|
||||
|
||||
/**
|
||||
* Build (or re-build) the visual editor.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function buildEditor() {
|
||||
var editor, triggerChangeIfDirty, onInit;
|
||||
var editor, onInit, showPointerElement;
|
||||
|
||||
// Abort building if the textarea is gone, likely due to the widget having been deleted entirely.
|
||||
if ( ! document.getElementById( id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The user has disabled TinyMCE.
|
||||
if ( typeof window.tinymce === 'undefined' ) {
|
||||
wp.editor.initialize( id, {
|
||||
quicktags: true
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Destroy any existing editor so that it can be re-initialized after a widget-updated event.
|
||||
if ( tinymce.get( id ) ) {
|
||||
restoreTextMode = tinymce.get( id ).isHidden();
|
||||
@@ -137,6 +248,20 @@ wp.textWidgets = ( function( $ ) {
|
||||
quicktags: true
|
||||
});
|
||||
|
||||
/**
|
||||
* Show a pointer, focus on dismiss, and speak the contents for a11y.
|
||||
*
|
||||
* @param {jQuery} pointerElement Pointer element.
|
||||
* @returns {void}
|
||||
*/
|
||||
showPointerElement = function( pointerElement ) {
|
||||
pointerElement.show();
|
||||
pointerElement.find( '.close' ).focus();
|
||||
wp.a11y.speak( pointerElement.find( 'h3, p' ).map( function() {
|
||||
return $( this ).text();
|
||||
} ).get().join( '\n\n' ) );
|
||||
};
|
||||
|
||||
editor = window.tinymce.get( id );
|
||||
if ( ! editor ) {
|
||||
throw new Error( 'Failed to initialize editor' );
|
||||
@@ -150,8 +275,36 @@ wp.textWidgets = ( function( $ ) {
|
||||
|
||||
// If a prior mce instance was replaced, and it was in text mode, toggle to text mode.
|
||||
if ( restoreTextMode ) {
|
||||
switchEditors.go( id, 'toggle' );
|
||||
switchEditors.go( id, 'html' );
|
||||
}
|
||||
|
||||
// Show the pointer.
|
||||
$( '#' + id + '-html' ).on( 'click', function() {
|
||||
control.pasteHtmlPointer.hide(); // Hide the HTML pasting pointer.
|
||||
|
||||
if ( -1 !== component.dismissedPointers.indexOf( 'text_widget_custom_html' ) ) {
|
||||
return;
|
||||
}
|
||||
showPointerElement( control.customHtmlWidgetPointer );
|
||||
});
|
||||
|
||||
// Hide the pointer when switching tabs.
|
||||
$( '#' + id + '-tmce' ).on( 'click', function() {
|
||||
control.customHtmlWidgetPointer.hide();
|
||||
});
|
||||
|
||||
// Show pointer when pasting HTML.
|
||||
editor.on( 'pastepreprocess', function( event ) {
|
||||
var content = event.content;
|
||||
if ( -1 !== component.dismissedPointers.indexOf( 'text_widget_paste_html' ) || ! content || ! /<\w+.*?>/.test( content ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Show the pointer after a slight delay so the user sees what they pasted.
|
||||
_.delay( function() {
|
||||
showPointerElement( control.pasteHtmlPointer );
|
||||
}, 250 );
|
||||
});
|
||||
};
|
||||
|
||||
if ( editor.initialized ) {
|
||||
@@ -161,38 +314,19 @@ wp.textWidgets = ( function( $ ) {
|
||||
}
|
||||
|
||||
control.editorFocused = false;
|
||||
triggerChangeIfDirty = function() {
|
||||
var updateWidgetBuffer = 300; // See wp.customize.Widgets.WidgetControl._setupUpdateUI() which uses 250ms for updateWidgetDebounced.
|
||||
if ( editor.isDirty() ) {
|
||||
|
||||
/*
|
||||
* Account for race condition in customizer where user clicks Save & Publish while
|
||||
* focus was just previously given to to the editor. Since updates to the editor
|
||||
* are debounced at 1 second and since widget input changes are only synced to
|
||||
* settings after 250ms, the customizer needs to be put into the processing
|
||||
* state during the time between the change event is triggered and updateWidget
|
||||
* logic starts. Note that the debounced update-widget request should be able
|
||||
* to be removed with the removal of the update-widget request entirely once
|
||||
* widgets are able to mutate their own instance props directly in JS without
|
||||
* having to make server round-trips to call the respective WP_Widget::update()
|
||||
* callbacks. See <https://core.trac.wordpress.org/ticket/33507>.
|
||||
*/
|
||||
if ( wp.customize ) {
|
||||
wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() + 1 );
|
||||
_.delay( function() {
|
||||
wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() - 1 );
|
||||
}, updateWidgetBuffer );
|
||||
}
|
||||
|
||||
editor.save();
|
||||
textarea.trigger( 'change' );
|
||||
}
|
||||
};
|
||||
editor.on( 'focus', function() {
|
||||
editor.on( 'focus', function onEditorFocus() {
|
||||
control.editorFocused = true;
|
||||
});
|
||||
editor.on( 'paste', function onEditorPaste() {
|
||||
editor.setDirty( true ); // Because pasting doesn't currently set the dirty state.
|
||||
triggerChangeIfDirty();
|
||||
});
|
||||
editor.on( 'NodeChange', function onNodeChange() {
|
||||
needsTextareaChangeTrigger = true;
|
||||
});
|
||||
editor.on( 'NodeChange', _.debounce( triggerChangeIfDirty, changeDebounceDelay ) );
|
||||
editor.on( 'blur', function() {
|
||||
editor.on( 'blur hide', function onEditorBlur() {
|
||||
control.editorFocused = false;
|
||||
triggerChangeIfDirty();
|
||||
});
|
||||
@@ -219,7 +353,7 @@ wp.textWidgets = ( function( $ ) {
|
||||
* @returns {void}
|
||||
*/
|
||||
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
|
||||
var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, widgetInside, renderWhenAnimationDone;
|
||||
var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, widgetInside, renderWhenAnimationDone, fieldContainer, syncContainer;
|
||||
widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
|
||||
|
||||
idBase = widgetForm.find( '> .id_base' ).val();
|
||||
@@ -228,13 +362,34 @@ wp.textWidgets = ( function( $ ) {
|
||||
}
|
||||
|
||||
// Prevent initializing already-added widgets.
|
||||
widgetId = widgetForm.find( '> .widget-id' ).val();
|
||||
widgetId = widgetForm.find( '.widget-id' ).val();
|
||||
if ( component.widgetControls[ widgetId ] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Bypass using TinyMCE when widget is in legacy mode.
|
||||
if ( ! widgetForm.find( '.visual' ).val() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a container element for the widget control fields.
|
||||
* This is inserted into the DOM immediately before the the .widget-content
|
||||
* element because the contents of this element are essentially "managed"
|
||||
* by PHP, where each widget update cause the entire element to be emptied
|
||||
* and replaced with the rendered output of WP_Widget::form() which is
|
||||
* sent back in Ajax request made to save/update the widget instance.
|
||||
* To prevent a "flash of replaced DOM elements and re-initialized JS
|
||||
* components", the JS template is rendered outside of the normal form
|
||||
* container.
|
||||
*/
|
||||
fieldContainer = $( '<div></div>' );
|
||||
syncContainer = widgetContainer.find( '.widget-content:first' );
|
||||
syncContainer.before( fieldContainer );
|
||||
|
||||
widgetControl = new component.TextWidgetControl({
|
||||
el: widgetContainer
|
||||
el: fieldContainer,
|
||||
syncContainer: syncContainer
|
||||
});
|
||||
|
||||
component.widgetControls[ widgetId ] = widgetControl;
|
||||
@@ -256,6 +411,40 @@ wp.textWidgets = ( function( $ ) {
|
||||
renderWhenAnimationDone();
|
||||
};
|
||||
|
||||
/**
|
||||
* Setup widget in accessibility mode.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
component.setupAccessibleMode = function setupAccessibleMode() {
|
||||
var widgetForm, idBase, widgetControl, fieldContainer, syncContainer;
|
||||
widgetForm = $( '.editwidget > form' );
|
||||
if ( 0 === widgetForm.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
idBase = widgetForm.find( '> .widget-control-actions > .id_base' ).val();
|
||||
if ( 'text' !== idBase ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Bypass using TinyMCE when widget is in legacy mode.
|
||||
if ( ! widgetForm.find( '.visual' ).val() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
fieldContainer = $( '<div></div>' );
|
||||
syncContainer = widgetForm.find( '> .widget-inside' );
|
||||
syncContainer.before( fieldContainer );
|
||||
|
||||
widgetControl = new component.TextWidgetControl({
|
||||
el: fieldContainer,
|
||||
syncContainer: syncContainer
|
||||
});
|
||||
|
||||
widgetControl.initializeEditor();
|
||||
};
|
||||
|
||||
/**
|
||||
* Sync widget instance data sanitized from server back onto widget model.
|
||||
*
|
||||
@@ -319,6 +508,11 @@ wp.textWidgets = ( function( $ ) {
|
||||
var widgetContainer = $( this );
|
||||
component.handleWidgetAdded( new jQuery.Event( 'widget-added' ), widgetContainer );
|
||||
});
|
||||
|
||||
// Accessibility mode.
|
||||
$( window ).on( 'load', function() {
|
||||
component.setupAccessibleMode();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
2
wp-admin/js/widgets/text-widgets.min.js
vendored
2
wp-admin/js/widgets/text-widgets.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -72,9 +72,9 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) )
|
||||
<?php media_upload_form(); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var post_id = <?php echo $post_id; ?>, shortform = 3;
|
||||
var post_id = <?php echo absint( $post_id ); ?>, shortform = 3;
|
||||
</script>
|
||||
<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
|
||||
<input type="hidden" name="post_id" id="post_id" value="<?php echo absint( $post_id ); ?>" />
|
||||
<?php wp_nonce_field('media-form'); ?>
|
||||
<div id="media-items" class="hide-if-no-js"></div>
|
||||
</form>
|
||||
|
||||
@@ -215,7 +215,7 @@ if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users
|
||||
require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var current_site_id = <?php echo $id; ?>;
|
||||
var current_site_id = <?php echo absint( $id ); ?>;
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ if ( empty( $plugins ) ) {
|
||||
$file = '';
|
||||
$plugin = '';
|
||||
if ( isset( $_REQUEST['file'] ) ) {
|
||||
$file = sanitize_text_field( $_REQUEST['file'] );
|
||||
$file = wp_unslash( $_REQUEST['file'] );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['plugin'] ) ) {
|
||||
$plugin = sanitize_text_field( $_REQUEST['plugin'] );
|
||||
$plugin = wp_unslash( $_REQUEST['plugin'] );
|
||||
}
|
||||
|
||||
if ( empty( $plugin ) ) {
|
||||
@@ -107,10 +107,10 @@ if ( isset( $_REQUEST['action'] ) && 'update' === $_REQUEST['action'] ) {
|
||||
}
|
||||
|
||||
if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network( $file ) ) || ! is_plugin_active( $file ) ) {
|
||||
activate_plugin( $plugin, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) );
|
||||
activate_plugin( $plugin, "plugin-editor.php?file=" . urlencode( $file ) . "&phperror=1", ! empty( $_GET['networkwide'] ) );
|
||||
} // we'll override this later if the plugin can be included without fatal error
|
||||
|
||||
wp_redirect( self_admin_url("plugin-editor.php?file=$file&plugin=$plugin&a=te&scrollto=$scrollto") );
|
||||
wp_redirect( self_admin_url( 'plugin-editor.php?file=' . urlencode( $file ) . '&plugin=' . urlencode( $plugin ) . "&a=te&scrollto=$scrollto" ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -203,18 +203,18 @@ if ( isset( $_REQUEST['action'] ) && 'update' === $_REQUEST['action'] ) {
|
||||
if ( is_plugin_active( $plugin ) ) {
|
||||
if ( is_writeable( $real_file ) ) {
|
||||
/* translators: %s: plugin file name */
|
||||
echo sprintf( __( 'Editing %s (active)' ), '<strong>' . $file . '</strong>' );
|
||||
echo sprintf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
|
||||
} else {
|
||||
/* translators: %s: plugin file name */
|
||||
echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . $file . '</strong>' );
|
||||
echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
|
||||
}
|
||||
} else {
|
||||
if ( is_writeable( $real_file ) ) {
|
||||
/* translators: %s: plugin file name */
|
||||
echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . $file . '</strong>' );
|
||||
echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
|
||||
} else {
|
||||
/* translators: %s: plugin file name */
|
||||
echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . $file . '</strong>' );
|
||||
echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
|
||||
}
|
||||
}
|
||||
?></big>
|
||||
@@ -259,7 +259,7 @@ foreach ( $plugin_files as $plugin_file ) :
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ) ?>&plugin=<?php echo urlencode( $plugin ) ?>"><?php echo $plugin_file ?></a></li>
|
||||
<li<?php echo $file == $plugin_file ? ' class="highlight"' : ''; ?>><a href="plugin-editor.php?file=<?php echo urlencode( $plugin_file ) ?>&plugin=<?php echo urlencode( $plugin ) ?>"><?php echo esc_html( $plugin_file ); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@ $pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
$action = $wp_list_table->current_action();
|
||||
|
||||
$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
|
||||
$plugin = isset($_REQUEST['plugin']) ? wp_unslash( $_REQUEST['plugin'] ) : '';
|
||||
$s = isset($_REQUEST['s']) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : '';
|
||||
|
||||
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
|
||||
@@ -39,10 +39,10 @@ if ( $action ) {
|
||||
|
||||
check_admin_referer('activate-plugin_' . $plugin);
|
||||
|
||||
$result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() );
|
||||
$result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );
|
||||
if ( is_wp_error( $result ) ) {
|
||||
if ( 'unexpected_output' == $result->get_error_code() ) {
|
||||
$redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
|
||||
$redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s");
|
||||
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
|
||||
exit;
|
||||
} else {
|
||||
@@ -73,7 +73,7 @@ if ( $action ) {
|
||||
|
||||
check_admin_referer('bulk-plugins');
|
||||
|
||||
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
||||
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
|
||||
|
||||
if ( is_network_admin() ) {
|
||||
foreach ( $plugins as $i => $plugin ) {
|
||||
@@ -122,9 +122,9 @@ if ( $action ) {
|
||||
check_admin_referer( 'bulk-plugins' );
|
||||
|
||||
if ( isset( $_GET['plugins'] ) )
|
||||
$plugins = explode( ',', $_GET['plugins'] );
|
||||
$plugins = explode( ',', wp_unslash( $_GET['plugins'] ) );
|
||||
elseif ( isset( $_POST['checked'] ) )
|
||||
$plugins = (array) $_POST['checked'];
|
||||
$plugins = (array) wp_unslash( $_POST['checked'] );
|
||||
else
|
||||
$plugins = array();
|
||||
|
||||
@@ -197,7 +197,7 @@ if ( $action ) {
|
||||
|
||||
check_admin_referer('bulk-plugins');
|
||||
|
||||
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
||||
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
|
||||
// Do not deactivate plugins which are already deactivated.
|
||||
if ( is_network_admin() ) {
|
||||
$plugins = array_filter( $plugins, 'is_plugin_active_for_network' );
|
||||
@@ -234,7 +234,7 @@ if ( $action ) {
|
||||
check_admin_referer('bulk-plugins');
|
||||
|
||||
//$_POST = from the plugin form; $_GET = from the FTP details screen.
|
||||
$plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
|
||||
$plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array();
|
||||
if ( empty( $plugins ) ) {
|
||||
wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
|
||||
exit;
|
||||
@@ -368,7 +368,7 @@ if ( $action ) {
|
||||
default:
|
||||
if ( isset( $_POST['checked'] ) ) {
|
||||
check_admin_referer('bulk-plugins');
|
||||
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
|
||||
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
|
||||
$sendback = wp_get_referer();
|
||||
|
||||
/** This action is documented in wp-admin/edit-comments.php */
|
||||
|
||||
@@ -16,7 +16,9 @@ $submenu_file = 'edit.php';
|
||||
|
||||
wp_reset_vars( array( 'action' ) );
|
||||
|
||||
if ( isset( $_GET['post'] ) )
|
||||
if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] )
|
||||
wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
|
||||
elseif ( isset( $_GET['post'] ) )
|
||||
$post_id = $post_ID = (int) $_GET['post'];
|
||||
elseif ( isset( $_POST['post_ID'] ) )
|
||||
$post_id = $post_ID = (int) $_POST['post_ID'];
|
||||
@@ -38,6 +40,10 @@ if ( $post ) {
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
}
|
||||
|
||||
if ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) {
|
||||
wp_die( __( 'A post type mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
|
||||
}
|
||||
|
||||
if ( isset( $_POST['deletepost'] ) )
|
||||
$action = 'delete';
|
||||
elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
|
||||
@@ -183,7 +189,7 @@ case 'editattachment':
|
||||
|
||||
// Update the thumbnail filename
|
||||
$newmeta = wp_get_attachment_metadata( $post_id, true );
|
||||
$newmeta['thumb'] = $_POST['thumb'];
|
||||
$newmeta['thumb'] = wp_basename( $_POST['thumb'] );
|
||||
|
||||
wp_update_attachment_metadata( $post_id, $newmeta );
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ function setup_config_display_header( $body_classes = array() ) {
|
||||
|
||||
$language = '';
|
||||
if ( ! empty( $_REQUEST['language'] ) ) {
|
||||
$language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );
|
||||
$language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );
|
||||
} elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
|
||||
$language = $GLOBALS['wp_local_package'];
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ if ( empty( $file ) ) {
|
||||
$relative_file = 'style.css';
|
||||
$file = $allowed_files['style.css'];
|
||||
} else {
|
||||
$relative_file = $file;
|
||||
$relative_file = wp_unslash( $file );
|
||||
$file = $theme->get_stylesheet_directory() . '/' . $relative_file;
|
||||
}
|
||||
|
||||
@@ -156,10 +156,12 @@ default:
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'File edited successfully.' ) ?></p></div>
|
||||
<?php endif;
|
||||
|
||||
$description = get_file_description( $relative_file );
|
||||
$file_description = get_file_description( $relative_file );
|
||||
$file_show = array_search( $file, array_filter( $allowed_files ) );
|
||||
if ( $description != $file_show )
|
||||
$description .= ' <span>(' . $file_show . ')</span>';
|
||||
$description = esc_html( $file_description );
|
||||
if ( $file_description != $file_show ) {
|
||||
$description .= ' <span>(' . esc_html( $file_show ) . ')</span>';
|
||||
}
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php echo esc_html( $title ); ?></h1>
|
||||
@@ -230,9 +232,9 @@ if ( $allowed_files ) :
|
||||
echo "\t<ul>\n";
|
||||
}
|
||||
|
||||
$file_description = get_file_description( $filename );
|
||||
$file_description = esc_html( get_file_description( $filename ) );
|
||||
if ( $filename !== basename( $absolute_filename ) || $file_description !== $filename ) {
|
||||
$file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>';
|
||||
$file_description .= '<br /><span class="nonessential">(' . esc_html( $filename ) . ')</span>';
|
||||
}
|
||||
|
||||
if ( $absolute_filename === $file ) {
|
||||
|
||||
@@ -331,7 +331,7 @@ $can_install = current_user_can( 'install_themes' );
|
||||
</tr>
|
||||
<?php foreach ( $broken_themes as $broken_theme ) : ?>
|
||||
<tr>
|
||||
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : $broken_theme->get_stylesheet(); ?></td>
|
||||
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?></td>
|
||||
<td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
|
||||
<?php
|
||||
if ( $can_delete ) {
|
||||
|
||||
@@ -189,7 +189,7 @@ include(ABSPATH . 'wp-admin/admin-header.php');
|
||||
<p><strong><?php _e('User updated.') ?></strong></p>
|
||||
<?php endif; ?>
|
||||
<?php if ( $wp_http_referer && false === strpos( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?>
|
||||
<p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('← Back to Users'); ?></a></p>
|
||||
<p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>"><?php _e('← Back to Users'); ?></a></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -70,7 +70,7 @@ if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
|
||||
add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) );
|
||||
$redirect = add_query_arg( array( 'update' => 'addnoconfirmation' , 'user_id' => $user_id ), 'user-new.php' );
|
||||
} else {
|
||||
$newuser_key = substr( md5( $user_id ), 0, 5 );
|
||||
$newuser_key = wp_generate_password( 20, false );
|
||||
add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST[ 'role' ] ) );
|
||||
|
||||
$roles = get_editable_roles();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Eleven ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.2
|
||||
Tested up to: WordPress 4.7-trunk
|
||||
Stable tag: 2.5
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Stable tag: 2.6
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
@@ -22,7 +22,7 @@ For more information about Twenty Eleven please go to https://codex.wordpress.or
|
||||
|
||||
== Copyright ==
|
||||
|
||||
Twenty Eleven WordPress Theme, Copyright 2011-2016 WordPress.org & Automattic.com
|
||||
Twenty Eleven WordPress Theme, Copyright 2011-2017 WordPress.org & Automattic.com
|
||||
Twenty Eleven is Distributed under the terms of the GNU GPL
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -43,6 +43,11 @@ Source: https://github.com/aFarkas/html5shiv
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.6 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Eleven_Theme_Changelog#Version_2.6
|
||||
|
||||
= 2.5 =
|
||||
* Released: August 15, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyeleven/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -- then go further with available theme options for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, support for featured images (as custom header images on posts and pages and as large images on featured "sticky" posts), and special styles for six different post formats.
|
||||
Version: 2.5
|
||||
Version: 2.6
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Fifteen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 4.1
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Version: 1.7
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Version: 1.8
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
|
||||
@@ -55,6 +55,11 @@ Source: http://www.genericons.com
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.8 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Fifteen_Theme_Changelog#Version_1.8
|
||||
|
||||
= 1.7 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfifteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
|
||||
Version: 1.7
|
||||
Version: 1.8
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Fourteen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.6
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Stable tag: 1.9
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Stable tag: 2.0
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
|
||||
@@ -22,7 +22,7 @@ For more information about Twenty Fourteen please go to https://codex.wordpress.
|
||||
|
||||
== Copyright ==
|
||||
|
||||
Twenty Fourteen WordPress Theme, Copyright 2013-2016 WordPress.org & Automattic.com
|
||||
Twenty Fourteen WordPress Theme, Copyright 2013-2017 WordPress.org & Automattic.com
|
||||
Twenty Fourteen is Distributed under the terms of the GNU GPL
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -50,6 +50,11 @@ Source: http://www.genericons.com
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.0 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_2.0
|
||||
|
||||
= 1.9 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfourteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier.
|
||||
Version: 1.9
|
||||
Version: 2.0
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Seventeen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 4.7
|
||||
Tested up to: WordPress 4.7
|
||||
Version: 1.2
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Version: 1.3
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
|
||||
@@ -60,6 +60,11 @@ Source: https://unsplash.com/@englr?photo=bIhpiQA009k
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.3 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Seventeen_Theme_Changelog#Version_1.3
|
||||
|
||||
= 1.2 =
|
||||
* Released: April 18, 2017
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyseventeen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
|
||||
Version: 1.2
|
||||
Version: 1.3
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: twentyseventeen
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Ten ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.0
|
||||
Tested up to: WordPress 4.7-trunk
|
||||
Stable tag: 2.2
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Stable tag: 2.3
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, two-columns, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu, flexible-header, featured-images, footer-widgets, featured-image-header
|
||||
@@ -22,7 +22,7 @@ For more information about Twenty Ten theme please go to https://codex.wordpress
|
||||
|
||||
== Copyright ==
|
||||
|
||||
Twenty Ten WordPress Theme, Copyright 2010-2016 WordPress.org & Automattic.com
|
||||
Twenty Ten WordPress Theme, Copyright 2010-2017 WordPress.org & Automattic.com
|
||||
Twenty Ten is Distributed under the terms of the GNU GPL
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -37,6 +37,11 @@ GNU General Public License for more details.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.3 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Ten_Theme_Changelog#Version_2.3
|
||||
|
||||
= 2.2 =
|
||||
* Released: August 15, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyten/
|
||||
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar.
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Version: 2.2
|
||||
Version: 2.3
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, two-columns, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu, flexible-header, featured-images, footer-widgets, featured-image-header
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Thirteen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.6
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Stable tag: 2.1
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Stable tag: 2.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-header, custom-menu, editor-style, featured-images, footer-widgets, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, accessibility-ready
|
||||
@@ -22,7 +22,7 @@ For more information about Twenty Thirteen please go to https://codex.wordpress.
|
||||
|
||||
== Copyright ==
|
||||
|
||||
Twenty Thirteen WordPress Theme, Copyright 2013-2016 WordPress.org & Automattic.com
|
||||
Twenty Thirteen WordPress Theme, Copyright 2013-2017 WordPress.org & Automattic.com
|
||||
Twenty Thirteen is Distributed under the terms of the GNU GPL
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -47,6 +47,11 @@ Source: http://www.genericons.com
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.2 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Thirteen_Theme_Changelog#Version_2.2
|
||||
|
||||
= 2.1 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentythirteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
|
||||
Version: 2.1
|
||||
Version: 2.2
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-header, custom-menu, editor-style, featured-images, footer-widgets, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, accessibility-ready
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Twelve ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.5
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Stable tag: 2.2
|
||||
Tested up to: WordPress 4.9-trunk
|
||||
Stable tag: 2.3
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
@@ -22,7 +22,7 @@ For more information about Twenty Twelve please go to https://codex.wordpress.or
|
||||
|
||||
== Copyright ==
|
||||
|
||||
Twenty Twelve WordPress Theme, Copyright 2012-2016 WordPress.org & Automattic.com
|
||||
Twenty Twelve WordPress Theme, Copyright 2012-2017 WordPress.org & Automattic.com
|
||||
Twenty Twelve is Distributed under the terms of the GNU GPL
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -43,6 +43,11 @@ Source: https://github.com/aFarkas/html5shiv
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.3 =
|
||||
* Released: June 8, 2017
|
||||
|
||||
https://codex.wordpress.org/Twenty_Twelve_Theme_Changelog#Version_2.3
|
||||
|
||||
= 2.2 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentytwelve/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
|
||||
Version: 2.2
|
||||
Version: 2.3
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -42,4 +42,5 @@ class Requests_Utility_FilteredIterator extends ArrayIterator {
|
||||
$value = call_user_func($this->callback, $value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -691,7 +691,7 @@ class WP_Object_Cache {
|
||||
echo "</p>";
|
||||
echo '<ul>';
|
||||
foreach ($this->cache as $group => $cache) {
|
||||
echo "<li><strong>Group:</strong> $group - ( " . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
|
||||
echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class WP_oEmbed {
|
||||
'#https?://kck\.st/.*#i' => array( 'https://www.kickstarter.com/services/oembed', true ),
|
||||
'#https?://cloudup\.com/.*#i' => array( 'https://cloudup.com/oembed', true ),
|
||||
'#https?://(www\.)?reverbnation\.com/.*#i' => array( 'https://www.reverbnation.com/oembed', true ),
|
||||
'#https?://videopress\.com/v/.*#' => array( 'https://public-api.wordpress.com/oembed/1.0/?for=' . $host, true ),
|
||||
'#https?://videopress\.com/v/.*#' => array( 'https://public-api.wordpress.com/oembed/?for=' . $host, true ),
|
||||
'#https?://(www\.)?reddit\.com/r/[^/]+/comments/.*#i' => array( 'https://www.reddit.com/oembed', true ),
|
||||
'#https?://(www\.)?speakerdeck\.com/.*#i' => array( 'https://speakerdeck.com/oembed.{format}', true ),
|
||||
'#https?://www\.facebook\.com/.*/posts/.*#i' => array( 'https://www.facebook.com/plugins/post/oembed.json/', true ),
|
||||
|
||||
@@ -265,7 +265,7 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
|
||||
$this->original_stylesheet = get_stylesheet();
|
||||
$this->theme = wp_get_theme( $args['theme'] );
|
||||
$this->theme = wp_get_theme( 0 === validate_file( $args['theme'] ) ? $args['theme'] : null );
|
||||
$this->messenger_channel = $args['messenger_channel'];
|
||||
$this->_changeset_uuid = $args['changeset_uuid'];
|
||||
|
||||
@@ -2527,13 +2527,12 @@ final class WP_Customize_Manager {
|
||||
$this->store_changeset_revision = $allow_revision;
|
||||
add_filter( 'wp_save_post_revision_post_has_changed', array( $this, '_filter_revision_post_has_changed' ), 5, 3 );
|
||||
|
||||
// Update the changeset post. The publish_customize_changeset action will cause the settings in the changeset to be saved via WP_Customize_Setting::save().
|
||||
$has_kses = ( false !== has_filter( 'content_save_pre', 'wp_filter_post_kses' ) );
|
||||
if ( $has_kses ) {
|
||||
kses_remove_filters(); // Prevent KSES from corrupting JSON in post_content.
|
||||
}
|
||||
|
||||
// Note that updating a post with publish status will trigger WP_Customize_Manager::publish_changeset_values().
|
||||
/*
|
||||
* Update the changeset post. The publish_customize_changeset action will cause the settings in the
|
||||
* changeset to be saved via WP_Customize_Setting::save(). Updating a post with publish status will
|
||||
* trigger WP_Customize_Manager::publish_changeset_values().
|
||||
*/
|
||||
add_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5, 3 );
|
||||
if ( $changeset_post_id ) {
|
||||
$post_array['edit_date'] = true; // Prevent date clearing.
|
||||
$r = wp_update_post( wp_slash( $post_array ), true );
|
||||
@@ -2543,9 +2542,9 @@ final class WP_Customize_Manager {
|
||||
$this->_changeset_post_id = $r; // Update cached post ID for the loaded changeset.
|
||||
}
|
||||
}
|
||||
if ( $has_kses ) {
|
||||
kses_init_filters();
|
||||
}
|
||||
|
||||
remove_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5 );
|
||||
|
||||
$this->_changeset_data = null; // Reset so WP_Customize_Manager::changeset_data() will re-populate with updated contents.
|
||||
|
||||
remove_filter( 'wp_save_post_revision_post_has_changed', array( $this, '_filter_revision_post_has_changed' ) );
|
||||
@@ -2562,6 +2561,51 @@ final class WP_Customize_Manager {
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserve the initial JSON post_content passed to save into the post.
|
||||
*
|
||||
* This is needed to prevent KSES and other {@see 'content_save_pre'} filters
|
||||
* from corrupting JSON data.
|
||||
*
|
||||
* Note that WP_Customize_Manager::validate_setting_values() have already
|
||||
* run on the setting values being serialized as JSON into the post content
|
||||
* so it is pre-sanitized.
|
||||
*
|
||||
* Also, the sanitization logic is re-run through the respective
|
||||
* WP_Customize_Setting::sanitize() method when being read out of the
|
||||
* changeset, via WP_Customize_Manager::post_value(), and this sanitized
|
||||
* value will also be sent into WP_Customize_Setting::update() for
|
||||
* persisting to the DB.
|
||||
*
|
||||
* Multiple users can collaborate on a single changeset, where one user may
|
||||
* have the unfiltered_html capability but another may not. A user with
|
||||
* unfiltered_html may add a script tag to some field which needs to be kept
|
||||
* intact even when another user updates the changeset to modify another field
|
||||
* when they do not have unfiltered_html.
|
||||
*
|
||||
* @since 5.4.1
|
||||
*
|
||||
* @param array $data An array of slashed and processed post data.
|
||||
* @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data.
|
||||
* @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as originally passed to wp_insert_post().
|
||||
* @return array Filtered post data.
|
||||
*/
|
||||
public function preserve_insert_changeset_post_content( $data, $postarr, $unsanitized_postarr ) {
|
||||
if (
|
||||
isset( $data['post_type'] ) &&
|
||||
isset( $unsanitized_postarr['post_content'] ) &&
|
||||
'customize_changeset' === $data['post_type'] ||
|
||||
(
|
||||
'revision' === $data['post_type'] &&
|
||||
! empty( $data['post_parent'] ) &&
|
||||
'customize_changeset' === get_post_type( $data['post_parent'] )
|
||||
)
|
||||
) {
|
||||
$data['post_content'] = $unsanitized_postarr['post_content'];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a changeset revision should be made.
|
||||
*
|
||||
|
||||
@@ -35,9 +35,23 @@ final class WP_Customize_Widgets {
|
||||
* @var array
|
||||
*/
|
||||
protected $core_widget_id_bases = array(
|
||||
'archives', 'calendar', 'categories', 'links', 'meta',
|
||||
'nav_menu', 'pages', 'recent-comments', 'recent-posts',
|
||||
'rss', 'search', 'tag_cloud', 'text',
|
||||
'archives',
|
||||
'calendar',
|
||||
'categories',
|
||||
'custom_html',
|
||||
'links',
|
||||
'media_audio',
|
||||
'media_image',
|
||||
'media_video',
|
||||
'meta',
|
||||
'nav_menu',
|
||||
'pages',
|
||||
'recent-comments',
|
||||
'recent-posts',
|
||||
'rss',
|
||||
'search',
|
||||
'tag_cloud',
|
||||
'text',
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -819,40 +819,45 @@ final class _WP_Editors {
|
||||
*
|
||||
*/
|
||||
public static function print_default_editor_scripts() {
|
||||
$settings = self::default_settings();
|
||||
$user_can_richedit = user_can_richedit();
|
||||
|
||||
$settings['toolbar1'] = 'bold,italic,bullist,numlist,link';
|
||||
$settings['wpautop'] = false;
|
||||
$settings['indent'] = true;
|
||||
$settings['elementpath'] = false;
|
||||
if ( $user_can_richedit ) {
|
||||
$settings = self::default_settings();
|
||||
|
||||
// In production all plugins are loaded (they are in wp-editor.js.gz)
|
||||
// but only these will be initialized by default.
|
||||
$settings['plugins'] = implode( ',', array(
|
||||
'charmap',
|
||||
'colorpicker',
|
||||
'hr',
|
||||
'lists',
|
||||
// 'media',
|
||||
'paste',
|
||||
'tabfocus',
|
||||
'textcolor',
|
||||
'fullscreen',
|
||||
'wordpress',
|
||||
'wpautoresize',
|
||||
'wpeditimage',
|
||||
'wpemoji',
|
||||
'wpgallery',
|
||||
'wplink',
|
||||
// 'wpdialogs',
|
||||
'wptextpattern',
|
||||
// 'wpview',
|
||||
) );
|
||||
$settings['toolbar1'] = 'bold,italic,bullist,numlist,link';
|
||||
$settings['wpautop'] = false;
|
||||
$settings['indent'] = true;
|
||||
$settings['elementpath'] = false;
|
||||
|
||||
$settings = self::_parse_init( $settings );
|
||||
if ( is_rtl() ) {
|
||||
$settings['directionality'] = 'rtl';
|
||||
}
|
||||
|
||||
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
||||
$baseurl = self::get_baseurl();
|
||||
// In production all plugins are loaded (they are in wp-editor.js.gz).
|
||||
// The 'wpview', 'wpdialogs', and 'media' TinyMCE plugins are not initialized by default.
|
||||
// Can be added from js by using the 'wp-before-tinymce-init' event.
|
||||
$settings['plugins'] = implode( ',', array(
|
||||
'charmap',
|
||||
'colorpicker',
|
||||
'hr',
|
||||
'lists',
|
||||
'paste',
|
||||
'tabfocus',
|
||||
'textcolor',
|
||||
'fullscreen',
|
||||
'wordpress',
|
||||
'wpautoresize',
|
||||
'wpeditimage',
|
||||
'wpemoji',
|
||||
'wpgallery',
|
||||
'wplink',
|
||||
'wptextpattern',
|
||||
) );
|
||||
|
||||
$settings = self::_parse_init( $settings );
|
||||
} else {
|
||||
$settings = '{}';
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
@@ -867,17 +872,29 @@ final class _WP_Editors {
|
||||
};
|
||||
};
|
||||
|
||||
var tinyMCEPreInit = {
|
||||
baseURL: "<?php echo $baseurl; ?>",
|
||||
suffix: "<?php echo $suffix; ?>",
|
||||
mceInit: {},
|
||||
qtInit: {},
|
||||
load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
|
||||
};
|
||||
<?php
|
||||
|
||||
if ( $user_can_richedit ) {
|
||||
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
||||
$baseurl = self::get_baseurl();
|
||||
|
||||
?>
|
||||
var tinyMCEPreInit = {
|
||||
baseURL: "<?php echo $baseurl; ?>",
|
||||
suffix: "<?php echo $suffix; ?>",
|
||||
mceInit: {},
|
||||
qtInit: {},
|
||||
load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
|
||||
};
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
self::print_tinymce_scripts();
|
||||
if ( $user_can_richedit ) {
|
||||
self::print_tinymce_scripts();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when the editor scripts are loaded for later initialization,
|
||||
|
||||
@@ -153,12 +153,13 @@ final class WP_oEmbed_Controller {
|
||||
*
|
||||
* @see WP_oEmbed::get_html()
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|array oEmbed response data or WP_Error on failure.
|
||||
* @return object|WP_Error oEmbed response data or WP_Error on failure.
|
||||
*/
|
||||
public function get_proxy_item( $request ) {
|
||||
$args = $request->get_params();
|
||||
|
||||
// Serve oEmbed data from cache if set.
|
||||
unset( $args['_wpnonce'] );
|
||||
$cache_key = 'oembed_' . md5( serialize( $args ) );
|
||||
$data = get_transient( $cache_key );
|
||||
if ( ! empty( $data ) ) {
|
||||
@@ -168,6 +169,14 @@ final class WP_oEmbed_Controller {
|
||||
$url = $request['url'];
|
||||
unset( $args['url'] );
|
||||
|
||||
// Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names.
|
||||
if ( isset( $args['maxwidth'] ) ) {
|
||||
$args['width'] = $args['maxwidth'];
|
||||
}
|
||||
if ( isset( $args['maxheight'] ) ) {
|
||||
$args['height'] = $args['maxheight'];
|
||||
}
|
||||
|
||||
$data = _wp_oembed_get_object()->get_data( $url, $args );
|
||||
|
||||
if ( false === $data ) {
|
||||
|
||||
@@ -582,7 +582,6 @@ class WP_Query {
|
||||
, 'attachment'
|
||||
, 'attachment_id'
|
||||
, 'name'
|
||||
, 'static'
|
||||
, 'pagename'
|
||||
, 'page_id'
|
||||
, 'second'
|
||||
@@ -809,11 +808,7 @@ class WP_Query {
|
||||
$this->is_single = true;
|
||||
} elseif ( $qv['p'] ) {
|
||||
$this->is_single = true;
|
||||
} elseif ( ('' !== $qv['hour']) && ('' !== $qv['minute']) &&('' !== $qv['second']) && ('' != $qv['year']) && ('' != $qv['monthnum']) && ('' != $qv['day']) ) {
|
||||
// If year, month, day, hour, minute, and second are set, a single
|
||||
// post is being queried.
|
||||
$this->is_single = true;
|
||||
} elseif ( '' != $qv['static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {
|
||||
} elseif ( '' != $qv['pagename'] || !empty($qv['page_id']) ) {
|
||||
$this->is_page = true;
|
||||
$this->is_single = false;
|
||||
} else {
|
||||
@@ -3058,7 +3053,15 @@ class WP_Query {
|
||||
*/
|
||||
$this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
|
||||
} else {
|
||||
$this->found_posts = count( $this->posts );
|
||||
if ( is_array( $this->posts ) ) {
|
||||
$this->found_posts = count( $this->posts );
|
||||
} else {
|
||||
if ( null === $this->posts ) {
|
||||
$this->found_posts = 0;
|
||||
} else {
|
||||
$this->found_posts = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3580,6 +3580,21 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
return new IXR_Error( 403, __( 'Comment is required.' ) );
|
||||
}
|
||||
|
||||
if (
|
||||
'publish' === get_post_status( $post_id ) &&
|
||||
! current_user_can( 'edit_post', $post_id ) &&
|
||||
post_password_required( $post_id )
|
||||
) {
|
||||
return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
|
||||
}
|
||||
|
||||
if (
|
||||
'private' === get_post_status( $post_id ) &&
|
||||
! current_user_can( 'read_post', $post_id )
|
||||
) {
|
||||
return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) );
|
||||
}
|
||||
|
||||
$comment = array(
|
||||
'comment_post_ID' => $post_id,
|
||||
'comment_content' => $content_struct['content'],
|
||||
@@ -3965,8 +3980,10 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
|
||||
do_action( 'xmlrpc_call', 'wp.getMediaItem' );
|
||||
|
||||
if ( ! $attachment = get_post($attachment_id) )
|
||||
$attachment = get_post( $attachment_id );
|
||||
if ( ! $attachment || 'attachment' !== $attachment->post_type ) {
|
||||
return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
|
||||
}
|
||||
|
||||
return $this->_prepare_media_item( $attachment );
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class WP {
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
|
||||
public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
|
||||
|
||||
/**
|
||||
* Private query variables.
|
||||
@@ -302,6 +302,8 @@ class WP {
|
||||
foreach ( $this->public_query_vars as $wpvar ) {
|
||||
if ( isset( $this->extra_query_vars[$wpvar] ) )
|
||||
$this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
|
||||
elseif ( isset( $_GET[ $wpvar ] ) && isset( $_POST[ $wpvar ] ) && $_GET[ $wpvar ] !== $_POST[ $wpvar ] )
|
||||
wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
|
||||
elseif ( isset( $_POST[$wpvar] ) )
|
||||
$this->query_vars[$wpvar] = $_POST[$wpvar];
|
||||
elseif ( isset( $_GET[$wpvar] ) )
|
||||
|
||||
@@ -3054,6 +3054,8 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
) {
|
||||
kses_remove_filters(); // start with a clean slate
|
||||
kses_init_filters(); // set up the filters
|
||||
remove_filter( 'pre_comment_content', 'wp_filter_post_kses' );
|
||||
add_filter( 'pre_comment_content', 'wp_filter_kses' );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
2
wp-includes/css/editor-rtl.min.css
vendored
2
wp-includes/css/editor-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-includes/css/editor.min.css
vendored
2
wp-includes/css/editor.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -60,3 +60,155 @@ require_once( ABSPATH . WPINC . '/widgets/class-wp-widget-tag-cloud.php' );
|
||||
|
||||
/** WP_Nav_Menu_Widget class */
|
||||
require_once( ABSPATH . WPINC . '/widgets/class-wp-nav-menu-widget.php' );
|
||||
|
||||
/**
|
||||
* Core class used to implement a Custom HTML widget.
|
||||
*
|
||||
* Note that this class is only located in this file in the 4.8 branch
|
||||
* for the sake of automatic updates. In 4.9 and above, it is located at
|
||||
* `wp-includes/widgets/class-wp-widget-custom-html.php`.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*
|
||||
* @see WP_Widget
|
||||
*/
|
||||
class WP_Widget_Custom_HTML extends WP_Widget {
|
||||
|
||||
/**
|
||||
* Default instance.
|
||||
*
|
||||
* @since 4.8.1
|
||||
* @var array
|
||||
*/
|
||||
protected $default_instance = array(
|
||||
'title' => '',
|
||||
'content' => '',
|
||||
);
|
||||
|
||||
/**
|
||||
* Sets up a new Custom HTML widget instance.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*/
|
||||
public function __construct() {
|
||||
$widget_ops = array(
|
||||
'classname' => 'widget_custom_html',
|
||||
'description' => __( 'Arbitrary HTML code.' ),
|
||||
'customize_selective_refresh' => true,
|
||||
);
|
||||
$control_ops = array(
|
||||
'width' => 400,
|
||||
'height' => 350,
|
||||
);
|
||||
parent::__construct( 'custom_html', __( 'Custom HTML' ), $widget_ops, $control_ops );
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the content for the current Custom HTML widget instance.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*
|
||||
* @param array $args Display arguments including 'before_title', 'after_title',
|
||||
* 'before_widget', and 'after_widget'.
|
||||
* @param array $instance Settings for the current Custom HTML widget instance.
|
||||
*/
|
||||
public function widget( $args, $instance ) {
|
||||
|
||||
$instance = array_merge( $this->default_instance, $instance );
|
||||
|
||||
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
|
||||
$title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
|
||||
|
||||
// Prepare instance data that looks like a normal Text widget.
|
||||
$simulated_text_widget_instance = array_merge( $instance, array(
|
||||
'text' => isset( $instance['content'] ) ? $instance['content'] : '',
|
||||
'filter' => false, // Because wpautop is not applied.
|
||||
'visual' => false, // Because it wasn't created in TinyMCE.
|
||||
) );
|
||||
unset( $simulated_text_widget_instance['content'] ); // Was moved to 'text' prop.
|
||||
|
||||
/** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
|
||||
$content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );
|
||||
|
||||
/**
|
||||
* Filters the content of the Custom HTML widget.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*
|
||||
* @param string $content The widget content.
|
||||
* @param array $instance Array of settings for the current widget.
|
||||
* @param WP_Widget_Custom_HTML $this Current Custom HTML widget instance.
|
||||
*/
|
||||
$content = apply_filters( 'widget_custom_html_content', $content, $instance, $this );
|
||||
|
||||
// Inject the Text widget's container class name alongside this widget's class name for theme styling compatibility.
|
||||
$args['before_widget'] = preg_replace( '/(?<=\sclass=["\'])/', 'widget_text ', $args['before_widget'] );
|
||||
|
||||
echo $args['before_widget'];
|
||||
if ( ! empty( $title ) ) {
|
||||
echo $args['before_title'] . $title . $args['after_title'];
|
||||
}
|
||||
echo '<div class="textwidget custom-html-widget">'; // The textwidget class is for theme styling compatibility.
|
||||
echo $content;
|
||||
echo '</div>';
|
||||
echo $args['after_widget'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles updating settings for the current Custom HTML widget instance.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*
|
||||
* @param array $new_instance New settings for this instance as input by the user via
|
||||
* WP_Widget::form().
|
||||
* @param array $old_instance Old settings for this instance.
|
||||
* @return array Settings to save or bool false to cancel saving.
|
||||
*/
|
||||
public function update( $new_instance, $old_instance ) {
|
||||
$instance = array_merge( $this->default_instance, $old_instance );
|
||||
$instance['title'] = sanitize_text_field( $new_instance['title'] );
|
||||
if ( current_user_can( 'unfiltered_html' ) ) {
|
||||
$instance['content'] = $new_instance['content'];
|
||||
} else {
|
||||
$instance['content'] = wp_kses_post( $new_instance['content'] );
|
||||
}
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the Custom HTML widget settings form.
|
||||
*
|
||||
* @since 4.8.1
|
||||
*
|
||||
* @param array $instance Current instance.
|
||||
* @returns void
|
||||
*/
|
||||
public function form( $instance ) {
|
||||
$instance = wp_parse_args( (array) $instance, $this->default_instance );
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'content' ); ?>"><?php _e( 'Content:' ); ?></label>
|
||||
<textarea class="widefat code" rows="16" cols="20" id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>"><?php echo esc_textarea( $instance['content'] ); ?></textarea>
|
||||
</p>
|
||||
|
||||
<?php if ( ! current_user_can( 'unfiltered_html' ) ) : ?>
|
||||
<?php
|
||||
$probably_unsafe_html = array( 'script', 'iframe', 'form', 'input', 'style' );
|
||||
$allowed_html = wp_kses_allowed_html( 'post' );
|
||||
$disallowed_html = array_diff( $probably_unsafe_html, array_keys( $allowed_html ) );
|
||||
?>
|
||||
<?php if ( ! empty( $disallowed_html ) ) : ?>
|
||||
<p>
|
||||
<?php _e( 'Some HTML tags are not permitted, including:' ); ?>
|
||||
<code><?php echo join( '</code>, <code>', $disallowed_html ); ?></code>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
@@ -753,24 +753,30 @@ function wp_filter_oembed_result( $result, $data, $url ) {
|
||||
}
|
||||
$html = $content[1] . $content[2];
|
||||
|
||||
preg_match( '/ src=([\'"])(.*?)\1/', $html, $results );
|
||||
|
||||
if ( ! empty( $results ) ) {
|
||||
$secret = wp_generate_password( 10, false );
|
||||
|
||||
$url = esc_url( "{$results[2]}#?secret=$secret" );
|
||||
$q = $results[1];
|
||||
|
||||
$html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html );
|
||||
$html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html );
|
||||
}
|
||||
|
||||
$allowed_html['blockquote']['data-secret'] = true;
|
||||
$allowed_html['iframe']['data-secret'] = true;
|
||||
|
||||
$html = wp_kses( $html, $allowed_html );
|
||||
|
||||
if ( ! empty( $content[1] ) ) {
|
||||
// We have a blockquote to fall back on. Hide the iframe by default.
|
||||
$html = str_replace( '<iframe', '<iframe style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"', $html );
|
||||
$html = str_replace( '<blockquote', '<blockquote class="wp-embedded-content"', $html );
|
||||
}
|
||||
|
||||
$html = str_replace( '<iframe', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $html );
|
||||
|
||||
preg_match( '/ src=[\'"]([^\'"]*)[\'"]/', $html, $results );
|
||||
|
||||
if ( ! empty( $results ) ) {
|
||||
$secret = wp_generate_password( 10, false );
|
||||
|
||||
$url = esc_url( "{$results[1]}#?secret=$secret" );
|
||||
|
||||
$html = str_replace( $results[0], " src=\"$url\" data-secret=\"$secret\"", $html );
|
||||
$html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html );
|
||||
}
|
||||
$html = str_ireplace( '<iframe', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $html );
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ function rss_enclosure() {
|
||||
*
|
||||
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
|
||||
*/
|
||||
echo apply_filters( 'rss_enclosure', '<enclosure url="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" length="' . trim( $enclosure[1] ) . '" type="' . $type . '" />' . "\n" );
|
||||
echo apply_filters( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,7 +510,7 @@ function atom_enclosure() {
|
||||
*
|
||||
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
|
||||
*/
|
||||
echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" );
|
||||
echo apply_filters( 'atom_enclosure', '<link href="' . esc_url( trim( $enclosure[0] ) ) . '" rel="enclosure" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( trim( $enclosure[2] ) ) . '" />' . "\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1076,9 +1076,9 @@ function wp_check_invalid_utf8( $string, $strip = false ) {
|
||||
* @return string String with Unicode encoded for URI.
|
||||
*/
|
||||
function utf8_uri_encode( $utf8_string, $length = 0 ) {
|
||||
$unicode = '';
|
||||
$values = array();
|
||||
$num_octets = 1;
|
||||
$unicode = '';
|
||||
$values = array();
|
||||
$num_octets = 1;
|
||||
$unicode_length = 0;
|
||||
|
||||
mbstring_binary_safe_encoding();
|
||||
@@ -1090,9 +1090,10 @@ function utf8_uri_encode( $utf8_string, $length = 0 ) {
|
||||
$value = ord( $utf8_string[ $i ] );
|
||||
|
||||
if ( $value < 128 ) {
|
||||
if ( $length && ( $unicode_length >= $length ) )
|
||||
if ( $length && ( $unicode_length >= $length ) ) {
|
||||
break;
|
||||
$unicode .= chr($value);
|
||||
}
|
||||
$unicode .= chr( $value );
|
||||
$unicode_length++;
|
||||
} else {
|
||||
if ( count( $values ) == 0 ) {
|
||||
@@ -1762,6 +1763,24 @@ function remove_accents( $string ) {
|
||||
function sanitize_file_name( $filename ) {
|
||||
$filename_raw = $filename;
|
||||
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0));
|
||||
|
||||
// Check for support for utf8 in the installed PCRE library once and store the result in a static.
|
||||
static $utf8_pcre = null;
|
||||
if ( ! isset( $utf8_pcre ) ) {
|
||||
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
|
||||
$utf8_pcre = @preg_match( '/^./u', 'a' );
|
||||
}
|
||||
|
||||
if ( ! seems_utf8( $filename ) ) {
|
||||
$_ext = pathinfo( $filename, PATHINFO_EXTENSION );
|
||||
$_name = pathinfo( $filename, PATHINFO_FILENAME );
|
||||
$filename = sanitize_title_with_dashes( $_name ) . '.' . $_ext;
|
||||
}
|
||||
|
||||
if ( $utf8_pcre ) {
|
||||
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the list of characters to remove from a filename.
|
||||
*
|
||||
@@ -1771,7 +1790,6 @@ function sanitize_file_name( $filename ) {
|
||||
* @param string $filename_raw Filename as it was passed into sanitize_file_name().
|
||||
*/
|
||||
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
|
||||
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
|
||||
$filename = str_replace( $special_chars, '', $filename );
|
||||
$filename = str_replace( array( '%20', '+' ), '-', $filename );
|
||||
$filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
|
||||
@@ -1976,7 +1994,7 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
|
||||
if (function_exists('mb_strtolower')) {
|
||||
$title = mb_strtolower($title, 'UTF-8');
|
||||
}
|
||||
$title = utf8_uri_encode($title, 200);
|
||||
$title = utf8_uri_encode( $title, 200 );
|
||||
}
|
||||
|
||||
$title = strtolower($title);
|
||||
@@ -2731,17 +2749,19 @@ function wp_rel_nofollow( $text ) {
|
||||
*/
|
||||
function wp_rel_nofollow_callback( $matches ) {
|
||||
$text = $matches[1];
|
||||
$atts = shortcode_parse_atts( $matches[1] );
|
||||
$atts = wp_kses_hair( $matches[1], wp_allowed_protocols() );
|
||||
$rel = 'nofollow';
|
||||
|
||||
if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
|
||||
preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
|
||||
) {
|
||||
return "<a $text>";
|
||||
if ( ! empty( $atts['href'] ) ) {
|
||||
if ( in_array( strtolower( wp_parse_url( $atts['href']['value'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) {
|
||||
if ( strtolower( wp_parse_url( $atts['href']['value'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) {
|
||||
return "<a $text>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $atts['rel'] ) ) {
|
||||
$parts = array_map( 'trim', explode( ' ', $atts['rel'] ) );
|
||||
$parts = array_map( 'trim', explode( ' ', $atts['rel']['value'] ) );
|
||||
if ( false === array_search( 'nofollow', $parts ) ) {
|
||||
$parts[] = 'nofollow';
|
||||
}
|
||||
@@ -2750,11 +2770,15 @@ function wp_rel_nofollow_callback( $matches ) {
|
||||
|
||||
$html = '';
|
||||
foreach ( $atts as $name => $value ) {
|
||||
$html .= "{$name}=\"$value\" ";
|
||||
if ( isset( $value['vless'] ) && 'y' === $value['vless'] ) {
|
||||
$html .= $name . ' ';
|
||||
} else {
|
||||
$html .= "{$name}=\"" . esc_attr( $value['value'] ) . '" ';
|
||||
}
|
||||
}
|
||||
$text = trim( $html );
|
||||
}
|
||||
return "<a $text rel=\"$rel\">";
|
||||
return "<a $text rel=\"" . esc_attr( $rel ) . "\">";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3738,6 +3762,11 @@ function _deep_replace( $search, $subject ) {
|
||||
* Sometimes, spot-escaping is required or useful. One example
|
||||
* is preparing an array for use in an IN clause.
|
||||
*
|
||||
* NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
|
||||
* this prevents certain SQLi attacks from taking place. This change in behaviour
|
||||
* may cause issues for code that expects the return value of esc_sql() to be useable
|
||||
* for other purposes.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
@@ -5077,7 +5106,7 @@ function _print_emoji_detection_script() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
|
||||
!function(a,b,c){function d(a){var b,c,d,e,f=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.clearRect(0,0,j.width,j.height),k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(f(55356,56826,55356,56819),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,56826,8203,55356,56819),0,0),c=j.toDataURL(),b===c&&(k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447),0,0),c=j.toDataURL(),b!==c);case"emoji4":return k.fillText(f(55358,56794,8205,9794,65039),0,0),d=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55358,56794,8203,9794,65039),0,0),e=j.toDataURL(),d!==e}return!1}function e(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d");for(i=Array("flag","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
!function(a,b,c){function d(a){var b,c,d,e,f=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.clearRect(0,0,j.width,j.height),k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(f(55356,56826,55356,56819),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,56826,8203,55356,56819),0,0),c=j.toDataURL(),b!==c&&(k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447),0,0),c=j.toDataURL(),b!==c);case"emoji4":return k.fillText(f(55358,56794,8205,9794,65039),0,0),d=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55358,56794,8203,9794,65039),0,0),e=j.toDataURL(),d!==e}return!1}function e(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d");for(i=Array("flag","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -1608,6 +1608,11 @@ function wp_mkdir_p( $target ) {
|
||||
if ( file_exists( $target ) )
|
||||
return @is_dir( $target );
|
||||
|
||||
// Do not allow path traversals.
|
||||
if ( false !== strpos( $target, '../' ) || false !== strpos( $target, '..' . DIRECTORY_SEPARATOR ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We need to find the permissions of the parent folder that exists and inherit that.
|
||||
$target_parent = dirname( $target );
|
||||
while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
|
||||
@@ -1699,17 +1704,30 @@ function path_join( $base, $path ) {
|
||||
* @since 3.9.0
|
||||
* @since 4.4.0 Ensures upper-case drive letters on Windows systems.
|
||||
* @since 4.5.0 Allows for Windows network shares.
|
||||
* @since 4.9.7 Allows for PHP file wrappers.
|
||||
*
|
||||
* @param string $path Path to normalize.
|
||||
* @return string Normalized path.
|
||||
*/
|
||||
function wp_normalize_path( $path ) {
|
||||
$wrapper = '';
|
||||
if ( wp_is_stream( $path ) ) {
|
||||
list( $wrapper, $path ) = explode( '://', $path, 2 );
|
||||
$wrapper .= '://';
|
||||
}
|
||||
|
||||
// Standardise all paths to use /
|
||||
$path = str_replace( '\\', '/', $path );
|
||||
|
||||
// Replace multiple slashes down to a singular, allowing for network shares having two slashes.
|
||||
$path = preg_replace( '|(?<=.)/+|', '/', $path );
|
||||
|
||||
// Windows paths should uppercase the drive letter
|
||||
if ( ':' === substr( $path, 1, 1 ) ) {
|
||||
$path = ucfirst( $path );
|
||||
}
|
||||
return $path;
|
||||
|
||||
return $wrapper . $path;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2320,17 +2338,52 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
$real_mime = finfo_file( $finfo, $file );
|
||||
finfo_close( $finfo );
|
||||
|
||||
/*
|
||||
* If $real_mime doesn't match what we're expecting, we need to do some extra
|
||||
* vetting of application mime types to make sure this type of file is allowed.
|
||||
* Other mime types are assumed to be safe, but should be considered unverified.
|
||||
*/
|
||||
if ( $real_mime && ( $real_mime !== $type ) && ( 0 === strpos( $real_mime, 'application' ) ) ) {
|
||||
$allowed = get_allowed_mime_types();
|
||||
// fileinfo often misidentifies obscure files as one of these types
|
||||
$nonspecific_types = array(
|
||||
'application/octet-stream',
|
||||
'application/encrypted',
|
||||
'application/CDFV2-encrypted',
|
||||
'application/zip',
|
||||
);
|
||||
|
||||
if ( ! in_array( $real_mime, $allowed ) ) {
|
||||
/*
|
||||
* If $real_mime doesn't match the content type we're expecting from the file's extension,
|
||||
* we need to do some additional vetting. Media types and those listed in $nonspecific_types are
|
||||
* allowed some leeway, but anything else must exactly match the real content type.
|
||||
*/
|
||||
if ( in_array( $real_mime, $nonspecific_types, true ) ) {
|
||||
// File is a non-specific binary type. That's ok if it's a type that generally tends to be binary.
|
||||
if ( !in_array( substr( $type, 0, strcspn( $type, '/' ) ), array( 'application', 'video', 'audio' ) ) ) {
|
||||
$type = $ext = false;
|
||||
}
|
||||
} elseif ( 0 === strpos( $real_mime, 'video/' ) || 0 === strpos( $real_mime, 'audio/' ) ) {
|
||||
/*
|
||||
* For these types, only the major type must match the real value.
|
||||
* This means that common mismatches are forgiven: application/vnd.apple.numbers is often misidentified as application/zip,
|
||||
* and some media files are commonly named with the wrong extension (.mov instead of .mp4)
|
||||
*/
|
||||
|
||||
if ( substr( $real_mime, 0, strcspn( $real_mime, '/' ) ) !== substr( $type, 0, strcspn( $type, '/' ) ) ) {
|
||||
$type = $ext = false;
|
||||
}
|
||||
} else {
|
||||
if ( $type !== $real_mime ) {
|
||||
/*
|
||||
* Everything else including image/* and application/*:
|
||||
* If the real content type doesn't match the file extension, assume it's dangerous.
|
||||
*/
|
||||
$type = $ext = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// The mime type must be allowed
|
||||
if ( $type ) {
|
||||
$allowed = get_allowed_mime_types();
|
||||
|
||||
if ( ! in_array( $type, $allowed ) ) {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2553,8 +2606,9 @@ function get_allowed_mime_types( $user = null ) {
|
||||
if ( function_exists( 'current_user_can' ) )
|
||||
$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
|
||||
|
||||
if ( empty( $unfiltered ) )
|
||||
unset( $t['htm|html'] );
|
||||
if ( empty( $unfiltered ) ) {
|
||||
unset( $t['htm|html'], $t['js'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters list of allowed mime types and file extensions.
|
||||
@@ -5447,6 +5501,28 @@ function wp_delete_file( $file ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a file if its path is within the given directory.
|
||||
*
|
||||
* @since 4.9.7
|
||||
*
|
||||
* @param string $file Absolute path to the file to delete.
|
||||
* @param string $directory Absolute path to a directory.
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
function wp_delete_file_from_directory( $file, $directory ) {
|
||||
$real_file = realpath( wp_normalize_path( $file ) );
|
||||
$real_directory = realpath( wp_normalize_path( $directory ) );
|
||||
|
||||
if ( false === $real_file || false === $real_directory || strpos( wp_normalize_path( $real_file ), trailingslashit( wp_normalize_path( $real_directory ) ) ) !== 0 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
wp_delete_file( $file );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload.
|
||||
*
|
||||
|
||||
@@ -715,7 +715,7 @@ function get_bloginfo( $show = '', $filter = 'raw' ) {
|
||||
*/
|
||||
$output = __( 'html_lang_attribute' );
|
||||
if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) {
|
||||
$output = get_locale();
|
||||
$output = is_admin() ? get_user_locale() : get_locale();
|
||||
$output = str_replace( '_', '-', $output );
|
||||
}
|
||||
break;
|
||||
@@ -2787,6 +2787,24 @@ function wp_no_robots() {
|
||||
echo "<meta name='robots' content='noindex,follow' />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a noindex,noarchive meta tag and referrer origin-when-cross-origin meta tag.
|
||||
*
|
||||
* Outputs a noindex,noarchive meta tag that tells web robots not to index or cache the page content.
|
||||
* Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full
|
||||
* url as a referrer to other sites when cross-origin assets are loaded.
|
||||
*
|
||||
* Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_sensitive_page_meta' );
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
function wp_sensitive_page_meta() {
|
||||
?>
|
||||
<meta name='robots' content='noindex,noarchive' />
|
||||
<meta name='referrer' content='strict-origin-when-cross-origin' />
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display site icon meta tags.
|
||||
*
|
||||
@@ -3152,12 +3170,14 @@ function get_language_attributes( $doctype = 'html' ) {
|
||||
if ( function_exists( 'is_rtl' ) && is_rtl() )
|
||||
$attributes[] = 'dir="rtl"';
|
||||
|
||||
if ( $lang = get_bloginfo('language') ) {
|
||||
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
|
||||
$attributes[] = "lang=\"$lang\"";
|
||||
if ( $lang = get_bloginfo( 'language' ) ) {
|
||||
if ( get_option( 'html_type' ) == 'text/html' || $doctype == 'html' ) {
|
||||
$attributes[] = 'lang="' . esc_attr( $lang ) . '"';
|
||||
}
|
||||
|
||||
if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )
|
||||
$attributes[] = "xml:lang=\"$lang\"";
|
||||
if ( get_option( 'html_type' ) != 'text/html' || $doctype == 'xhtml' ) {
|
||||
$attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
|
||||
}
|
||||
}
|
||||
|
||||
$output = implode(' ', $attributes);
|
||||
@@ -3690,25 +3710,25 @@ function get_the_generator( $type = '' ) {
|
||||
|
||||
switch ( $type ) {
|
||||
case 'html':
|
||||
$gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
|
||||
$gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '">';
|
||||
break;
|
||||
case 'xhtml':
|
||||
$gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '" />';
|
||||
$gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '" />';
|
||||
break;
|
||||
case 'atom':
|
||||
$gen = '<generator uri="https://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>';
|
||||
$gen = '<generator uri="https://wordpress.org/" version="' . esc_attr( get_bloginfo_rss( 'version' ) ) . '">WordPress</generator>';
|
||||
break;
|
||||
case 'rss2':
|
||||
$gen = '<generator>https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
|
||||
$gen = '<generator>' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '</generator>';
|
||||
break;
|
||||
case 'rdf':
|
||||
$gen = '<admin:generatorAgent rdf:resource="https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
|
||||
$gen = '<admin:generatorAgent rdf:resource="' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '" />';
|
||||
break;
|
||||
case 'comment':
|
||||
$gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
|
||||
$gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo( 'version' ) ) . '" -->';
|
||||
break;
|
||||
case 'export':
|
||||
$gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
|
||||
$gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo_rss( 'version' ) ) . '" created="' . date( 'Y-m-d H:i' ) . '" -->';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@ function wp_http_validate_url( $url ) {
|
||||
$parsed_home = @parse_url( get_option( 'home' ) );
|
||||
|
||||
if ( isset( $parsed_home['host'] ) ) {
|
||||
$same_host = ( strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ) || 'localhost' === strtolower( $parsed_url['host'] ) );
|
||||
$same_host = strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] );
|
||||
} else {
|
||||
$same_host = false;
|
||||
}
|
||||
@@ -541,8 +541,9 @@ function wp_http_validate_url( $url ) {
|
||||
$ip = $host;
|
||||
} else {
|
||||
$ip = gethostbyname( $host );
|
||||
if ( $ip === $host ) // Error condition for gethostbyname()
|
||||
$ip = false;
|
||||
if ( $ip === $host ) { // Error condition for gethostbyname()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ( $ip ) {
|
||||
$parts = array_map( 'intval', explode( '.', $ip ) );
|
||||
|
||||
10
wp-includes/js/jquery/jquery.js
vendored
10
wp-includes/js/jquery/jquery.js
vendored
File diff suppressed because one or more lines are too long
@@ -155,8 +155,6 @@
|
||||
encodedText,
|
||||
instance;
|
||||
|
||||
text = tinymce.DOM.decode( text );
|
||||
|
||||
if ( text.indexOf( '[' ) !== -1 && text.indexOf( ']' ) !== -1 ) {
|
||||
// Looks like a shortcode? Remove any line breaks from inside of shortcodes
|
||||
// or autop will replace them with <p> and <br> later and the string won't match.
|
||||
@@ -431,7 +429,7 @@
|
||||
var selected = node === editor.selection.getNode();
|
||||
var $viewNode;
|
||||
|
||||
if ( ! this.loader && $( node ).text() !== this.text ) {
|
||||
if ( ! this.loader && $( node ).text() !== tinymce.DOM.decode( this.text ) ) {
|
||||
editor.dom.setAttrib( node, 'data-wpview-marker', null );
|
||||
return;
|
||||
}
|
||||
@@ -502,6 +500,14 @@
|
||||
setIframes: function( head, body, callback, rendered ) {
|
||||
var self = this;
|
||||
|
||||
if ( body.indexOf( '[' ) !== -1 && body.indexOf( ']' ) !== -1 ) {
|
||||
var shortcodesRegExp = new RegExp( '\\[\\/?(?:' + window.mceViewL10n.shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' );
|
||||
// Escape tags inside shortcode previews.
|
||||
body = body.replace( shortcodesRegExp, function( match ) {
|
||||
return match.replace( /</g, '<' ).replace( />/g, '>' );
|
||||
} );
|
||||
}
|
||||
|
||||
this.getNodes( function( editor, node ) {
|
||||
var dom = editor.dom,
|
||||
styles = '',
|
||||
|
||||
2
wp-includes/js/mce-view.min.js
vendored
2
wp-includes/js/mce-view.min.js
vendored
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user