Compare commits
218 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c118aa77f | ||
|
|
52f7b371de | ||
|
|
03372aee6e | ||
|
|
896d4d588b | ||
|
|
9f7a3edab3 | ||
|
|
c7feb3f848 | ||
|
|
6965572495 | ||
|
|
c623e36b53 | ||
|
|
f8abe372b5 | ||
|
|
348c871b83 | ||
|
|
a6e4d88a7a | ||
|
|
1150c36593 | ||
|
|
dc7409e713 | ||
|
|
9442d0f7e5 | ||
|
|
fab981a1cb | ||
|
|
128e2430a8 | ||
|
|
58a90c49c1 | ||
|
|
e1a05244d9 | ||
|
|
2dd32a25ce | ||
|
|
8c00811afd | ||
|
|
df6538cd9e | ||
|
|
3fa991919a | ||
|
|
188c405997 | ||
|
|
69cb93fc01 | ||
|
|
7bd9d508d8 | ||
|
|
7fb75fbac4 | ||
|
|
006095dd57 | ||
|
|
7fd3a9f5f7 | ||
|
|
682e48d5bd | ||
|
|
309d82f2bc | ||
|
|
b5bae28a24 | ||
|
|
09ddadad9c | ||
|
|
19b1303e66 | ||
|
|
e4a4b23b1e | ||
|
|
1b8cce073d | ||
|
|
c46690c68b | ||
|
|
046ba97ee5 | ||
|
|
62423cc81f | ||
|
|
2a5436237f | ||
|
|
a18a45296d | ||
|
|
8c9519f1e7 | ||
|
|
d8e9c02011 | ||
|
|
80a325fda9 | ||
|
|
a17059be19 | ||
|
|
76ec03176d | ||
|
|
9b92304fd1 | ||
|
|
ee47cb6d42 | ||
|
|
79224df81a | ||
|
|
f6afa94bef | ||
|
|
30570f494f | ||
|
|
a5756e9c27 | ||
|
|
f5db1e4375 | ||
|
|
d46699267b | ||
|
|
0237d2915a | ||
|
|
435ca07747 | ||
|
|
66aaaa6aa8 | ||
|
|
73b0352cba | ||
|
|
700dd168fd | ||
|
|
9febffc6f7 | ||
|
|
c2f264d25f | ||
|
|
a81079c403 | ||
|
|
063e974bd7 | ||
|
|
a05429ecd1 | ||
|
|
f2ef35f4a9 | ||
|
|
244804028c | ||
|
|
fcec9ed6ff | ||
|
|
ca488f141f | ||
|
|
946d349b71 | ||
|
|
6e66a60c3c | ||
|
|
a81be45d5d | ||
|
|
13a15e6e07 | ||
|
|
ec5bf14855 | ||
|
|
e2ef6cefbe | ||
|
|
c47e0b66a2 | ||
|
|
95c2ed6e0d | ||
|
|
d9f0c45795 | ||
|
|
8d2a900277 | ||
|
|
924f935cb3 | ||
|
|
498ad8eb14 | ||
|
|
1db0b6e251 | ||
|
|
40ce4b29b1 | ||
|
|
57383c5143 | ||
|
|
04cab520ed | ||
|
|
ca27550a35 | ||
|
|
cc80d2c131 | ||
|
|
391fa0940c | ||
|
|
41276a8b92 | ||
|
|
b7be0d01c0 | ||
|
|
9858249ed9 | ||
|
|
5d8157a774 | ||
|
|
5995443179 | ||
|
|
e3098a4983 | ||
|
|
3c90ea60d9 | ||
|
|
0f819f1f57 | ||
|
|
7f38e9a815 | ||
|
|
d1db26f726 | ||
|
|
7da57d4ef3 | ||
|
|
594a9e14e7 | ||
|
|
8576838329 | ||
|
|
ba70965edc | ||
|
|
0ff6ca33c7 | ||
|
|
ea26079cde | ||
|
|
53226bc6f2 | ||
|
|
dfea282b1d | ||
|
|
97a834aaab | ||
|
|
5014bb866c | ||
|
|
96ad697c96 | ||
|
|
4686a8e4e7 | ||
|
|
5ef1e3048b | ||
|
|
831baf7b04 | ||
|
|
fdc6949e64 | ||
|
|
008ebcfae7 | ||
|
|
0c61562bf5 | ||
|
|
b7606aaa3c | ||
|
|
3edf686b37 | ||
|
|
fc3a293811 | ||
|
|
31ebb3f94b | ||
|
|
996d8547e3 | ||
|
|
7a06b64959 | ||
|
|
8417706532 | ||
|
|
811541dfe6 | ||
|
|
792858da14 | ||
|
|
bb869f458b | ||
|
|
9641009151 | ||
|
|
aff3c77aad | ||
|
|
c5eb54f359 | ||
|
|
98037bb876 | ||
|
|
d4608a9fe5 | ||
|
|
464ce8a75f | ||
|
|
8f57ec6bbf | ||
|
|
96890b155a | ||
|
|
fbb0252a46 | ||
|
|
16156dcff9 | ||
|
|
cfb6ef101b | ||
|
|
1c86df8bbf | ||
|
|
b2c747a38e | ||
|
|
10be03b2d7 | ||
|
|
ad0a3701d4 | ||
|
|
67a0654bcb | ||
|
|
fa12b4a44c | ||
|
|
4e39f0ba11 | ||
|
|
b435ecd2f8 | ||
|
|
6af36f8915 | ||
|
|
f56dd747c8 | ||
|
|
2a42fc2e73 | ||
|
|
7bd9e93fef | ||
|
|
6c6ea88f7d | ||
|
|
dc27207e1f | ||
|
|
27c4e15959 | ||
|
|
ff692384e0 | ||
|
|
e4e09f8491 | ||
|
|
8b1471168e | ||
|
|
932a7677e8 | ||
|
|
d7aecf3611 | ||
|
|
a067868b73 | ||
|
|
6f300d7d12 | ||
|
|
940eb60ad7 | ||
|
|
ca3e6728d1 | ||
|
|
5594f44f40 | ||
|
|
bb7e7f5a0b | ||
|
|
e8ea407eb6 | ||
|
|
c0357c466d | ||
|
|
3fa0efa6e3 | ||
|
|
05c849b3ee | ||
|
|
3224f9b9c2 | ||
|
|
14f8d5a6e5 | ||
|
|
f62b6a2c8b | ||
|
|
f00aac7c5c | ||
|
|
824ca5b030 | ||
|
|
9173953c3e | ||
|
|
ac2d674473 | ||
|
|
b86cd8511b | ||
|
|
ad39a33a22 | ||
|
|
c4b546f41f | ||
|
|
7d2bc0ab0d | ||
|
|
ef84a2bea6 | ||
|
|
c462d023dd | ||
|
|
01793d489b | ||
|
|
38b8a2fbf9 | ||
|
|
f87cbbf9c9 | ||
|
|
3c530e46cb | ||
|
|
e1f345903f | ||
|
|
d6656c58e0 | ||
|
|
dfb0e1aaa8 | ||
|
|
c51b6347e4 | ||
|
|
8b65448e85 | ||
|
|
900f223ed5 | ||
|
|
73a09188b8 | ||
|
|
c85dc97274 | ||
|
|
f2512c50eb | ||
|
|
524068c83b | ||
|
|
daddadfb70 | ||
|
|
9753a18ddf | ||
|
|
17457983b4 | ||
|
|
b4245bb9f6 | ||
|
|
8649425906 | ||
|
|
21796de8ba | ||
|
|
6e4bb1ab4a | ||
|
|
0579fdbc6a | ||
|
|
6b49e2278b | ||
|
|
f2f0f62a3e | ||
|
|
44c39135ab | ||
|
|
75c9032983 | ||
|
|
b5e12ae249 | ||
|
|
f690e6fe0f | ||
|
|
2766c5f44d | ||
|
|
7aa8fbd1dd | ||
|
|
fba1c51e98 | ||
|
|
fe6fdac4c1 | ||
|
|
653bc12e2b | ||
|
|
df62215a18 | ||
|
|
09e4a3ca6c | ||
|
|
3b0cc6d419 | ||
|
|
07e6c72972 | ||
|
|
37d4b468ea | ||
|
|
3dd112ef79 | ||
|
|
0cecdccf75 | ||
|
|
57db9dcaa2 |
@@ -1,6 +1,6 @@
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2014 by the contributors
|
||||
Copyright 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
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<body>
|
||||
<h1 id="logo">
|
||||
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
|
||||
<br /> Version 3.9
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -63,12 +107,13 @@ function wpmu_activate_stylesheet() {
|
||||
<?php
|
||||
}
|
||||
add_action( 'wp_head', 'wpmu_activate_stylesheet' );
|
||||
add_action( 'wp_head', 'wp_sensitive_page_meta' );
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="content" class="widecolumn">
|
||||
<?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'); ?>">
|
||||
@@ -82,28 +127,25 @@ get_header();
|
||||
</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( __('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( __('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( __('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>
|
||||
<?php
|
||||
echo '<p>'.$result->get_error_message().'</p>';
|
||||
printf( __('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 ) ) {
|
||||
echo '<p>' . $result->get_error_message() . '</p>';
|
||||
} ?>
|
||||
<?php
|
||||
} else {
|
||||
extract($result);
|
||||
$url = get_blogaddress_by_id( (int) $blog_id);
|
||||
|
||||
@@ -38,10 +38,263 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 33 ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'3.9.33'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.33' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'3.9.32'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.32' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'3.9.31'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.31' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed one security issue.' ),
|
||||
'3.9.30'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.30' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'3.9.29'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.29' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'3.9.28'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.28' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed a security issue.' ),
|
||||
'3.9.27'
|
||||
);
|
||||
?>
|
||||
<?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( '3.9.27' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: WordPress version number */
|
||||
printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '3.9.26' );
|
||||
?>
|
||||
<?php
|
||||
/* translators: %s: Codex URL */
|
||||
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.26' );
|
||||
?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '3.9.25' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.25' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '3.9.24' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.24' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '3.9.23' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.23' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 4 ), '3.9.22' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.22' ); ?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed one security issue.' ), '3.9.21' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.21' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 7 ), '3.9.20' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.20' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 5 ), '3.9.19' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.19' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '3.9.18', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.18' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 5 ), '3.9.17' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.17' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 3 ), '3.9.16' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.16' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 8 ), '3.9.15' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.15' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '3.9.14' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.14' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 9 ), '3.9.13' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.13' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '3.9.12' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.12' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '3.9.11' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.11' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '3.9.10' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.10' ); ?>
|
||||
</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.', 2 ), '3.9.9', number_format_i18n( 2 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.9' ); ?>
|
||||
</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.', 2 ), '3.9.8', number_format_i18n( 2 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.8' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '3.9.7' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.7' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 3 ), '3.9.6', number_format_i18n( 3 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.6' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '3.9.5', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.5' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 8 ), '3.9.4' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.4' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 9 ), '3.9.3', number_format_i18n( 9 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.3' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '3.9.2', number_format_i18n( 6 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.2' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 34 ), '3.9.1', number_format_i18n( 34 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<div class="about-overview">
|
||||
<?php
|
||||
if ( ( $locale = get_locale() ) && 'en_' === substr( $locale, 0, 3 ) ) : ?>
|
||||
if ( ! is_ssl() && ( $locale = get_locale() ) && 'en_' === substr( $locale, 0, 3 ) ) : ?>
|
||||
<embed src="//v0.wordpress.com/player.swf?v=1.03" type="application/x-shockwave-flash" width="640" height="360" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=sAiXhCfV&isDynamicSeeking=true" title=""></embed>
|
||||
<?php else : ?>
|
||||
<img class="about-overview-img" src="//s.w.org/images/core/3.9/overview.png?0" />
|
||||
|
||||
@@ -32,7 +32,7 @@ require_once( ABSPATH . 'wp-admin/includes/admin.php' );
|
||||
/** Load Ajax Handlers for WordPress Core */
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
|
||||
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
||||
@header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
|
||||
@header( 'X-Robots-Tag: noindex' );
|
||||
|
||||
send_nosniff_header();
|
||||
|
||||
@@ -58,13 +58,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">
|
||||
|
||||
@@ -82,7 +82,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating to WordPress %s, the most beautiful WordPress yet.' ), $display_version ); ?></div>
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s has lots of refinements we think you’ll love.' ), $display_version ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ ul#adminmenu > li.current > a.current:after {
|
||||
}
|
||||
|
||||
#adminmenu .awaiting-mod,
|
||||
#adminmenu span.update-plugins,
|
||||
#adminmenu .update-plugins,
|
||||
#sidemenu li a span.update-plugins {
|
||||
display: inline-block;
|
||||
background-color: #d54e21;
|
||||
|
||||
@@ -500,7 +500,7 @@ ul#adminmenu > li.current > a.current:after {
|
||||
}
|
||||
|
||||
#adminmenu .awaiting-mod,
|
||||
#adminmenu span.update-plugins,
|
||||
#adminmenu .update-plugins,
|
||||
#sidemenu li a span.update-plugins {
|
||||
display: inline-block;
|
||||
background-color: #d54e21;
|
||||
|
||||
@@ -355,7 +355,7 @@ td.plugin-title p {
|
||||
#content-resize-handle {
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll left bottom;
|
||||
width: 12px;
|
||||
cursor: n-resize;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.rtl #content-resize-handle {
|
||||
|
||||
@@ -355,7 +355,7 @@ td.plugin-title p {
|
||||
#content-resize-handle {
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
|
||||
width: 12px;
|
||||
cursor: n-resize;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.rtl #content-resize-handle {
|
||||
|
||||
@@ -75,24 +75,6 @@ input[type=radio] {
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked:before,
|
||||
input[type=radio]:checked:before {
|
||||
float: right;
|
||||
@@ -268,6 +250,24 @@ input[readonly] {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
2.0 - Forms
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -75,24 +75,6 @@ input[type=radio] {
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked:before,
|
||||
input[type=radio]:checked:before {
|
||||
float: left;
|
||||
@@ -268,6 +250,24 @@ input[readonly] {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
2.0 - Forms
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
2
wp-admin/css/login-rtl.min.css
vendored
2
wp-admin/css/login-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login.min.css
vendored
2
wp-admin/css/login.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin-rtl.min.css
vendored
2
wp-admin/css/wp-admin-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin.min.css
vendored
2
wp-admin/css/wp-admin.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -411,6 +411,7 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) )
|
||||
}
|
||||
|
||||
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 */
|
||||
|
||||
@@ -40,7 +40,7 @@ class Custom_Image_Header {
|
||||
* @since 3.0.0
|
||||
* @access private
|
||||
*/
|
||||
var $default_headers;
|
||||
var $default_headers = array();
|
||||
|
||||
/**
|
||||
* Holds custom headers uploaded by the user.
|
||||
@@ -254,7 +254,7 @@ class Custom_Image_Header {
|
||||
if ( !isset($_wp_default_headers) )
|
||||
return;
|
||||
|
||||
if ( is_array( $this->default_headers ) ) {
|
||||
if ( ! empty( $this->default_headers ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ class Custom_Image_Header {
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
var default_color = '#<?php echo get_theme_support( 'custom-header', 'default-text-color' ); ?>',
|
||||
var default_color = '#<?php echo esc_js( get_theme_support( 'custom-header', 'default-text-color' ) ); ?>',
|
||||
header_text_fields;
|
||||
|
||||
function pickColor(color) {
|
||||
|
||||
@@ -17,9 +17,10 @@ if ( ! current_user_can( 'edit_theme_options' ) )
|
||||
|
||||
wp_reset_vars( array( 'url', 'return' ) );
|
||||
$url = urldecode( $url );
|
||||
$url = esc_url_raw( $url );
|
||||
$url = wp_validate_redirect( $url, home_url( '/' ) );
|
||||
if ( $return )
|
||||
$return = wp_validate_redirect( urldecode( $return ) );
|
||||
$return = wp_validate_redirect( esc_url_raw( urldecode( $return ) ) );
|
||||
if ( ! $return )
|
||||
$return = $url;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating to WordPress %s, the most beautiful WordPress yet.' ), $display_version ); ?></div>
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s has lots of refinements we think you’ll love.' ), $display_version ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
|
||||
@@ -801,6 +801,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 {
|
||||
@@ -1323,11 +1325,13 @@ function wp_ajax_inline_save() {
|
||||
if ( isset($data['post_parent']) )
|
||||
$data['parent_id'] = $data['post_parent'];
|
||||
|
||||
// status
|
||||
if ( isset($data['keep_private']) && 'private' == $data['keep_private'] )
|
||||
// Status.
|
||||
if ( isset( $data['keep_private'] ) && 'private' == $data['keep_private'] ) {
|
||||
$data['visibility'] = 'private';
|
||||
$data['post_status'] = 'private';
|
||||
else
|
||||
} else {
|
||||
$data['post_status'] = $data['_status'];
|
||||
}
|
||||
|
||||
if ( empty($data['comment_status']) )
|
||||
$data['comment_status'] = 'closed';
|
||||
@@ -1602,7 +1606,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' ) ) ) {
|
||||
@@ -1612,7 +1620,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'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -1627,7 +1635,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'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -2164,7 +2172,7 @@ function wp_ajax_get_revision_diffs() {
|
||||
if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
|
||||
wp_send_json_error();
|
||||
|
||||
if ( ! current_user_can( 'read_post', $post->ID ) )
|
||||
if ( ! current_user_can( 'edit_post', $post->ID ) )
|
||||
wp_send_json_error();
|
||||
|
||||
// Really just pre-loading the cache here.
|
||||
@@ -2233,7 +2241,7 @@ function wp_ajax_query_themes() {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
$update_php = self_admin_url( 'update.php?action=install-theme' );
|
||||
$update_php = network_admin_url( 'update.php?action=install-theme' );
|
||||
foreach ( $api->themes as &$theme ) {
|
||||
$theme->install_url = add_query_arg( array(
|
||||
'theme' => $theme->slug,
|
||||
|
||||
@@ -537,9 +537,9 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
if ( current_user_can( 'edit_post', $post->ID ) ) {
|
||||
$post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
|
||||
$post_link .= get_the_title( $post->ID ) . '</a>';
|
||||
$post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
|
||||
} else {
|
||||
$post_link = get_the_title( $post->ID );
|
||||
$post_link = esc_html( get_the_title( $post->ID ) );
|
||||
}
|
||||
|
||||
echo '<div class="response-links"><span class="post-com-count-wrapper">';
|
||||
|
||||
@@ -219,7 +219,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>";
|
||||
echo "<td $attributes><a href='" . esc_url( "mailto:$user->user_email" ) . "'>$user->user_email</a></td>";
|
||||
break;
|
||||
|
||||
case 'registered':
|
||||
|
||||
@@ -376,26 +376,26 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
if ( $screen->in_admin( 'network' ) ) {
|
||||
if ( $is_active ) {
|
||||
if ( current_user_can( 'manage_network_plugins' ) )
|
||||
$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) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('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) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
|
||||
} else {
|
||||
if ( current_user_can( 'manage_network_plugins' ) )
|
||||
$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) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('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) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
|
||||
if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('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') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
|
||||
}
|
||||
} else {
|
||||
if ( $is_active ) {
|
||||
$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) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('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) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
|
||||
} else {
|
||||
$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) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('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) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
|
||||
|
||||
if ( ! is_multisite() && current_user_can('delete_plugins') )
|
||||
$actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('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') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
|
||||
} // end if $is_active
|
||||
} // end if $screen->in_admin( 'network' )
|
||||
|
||||
if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
|
||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . urlencode( $plugin_file ) . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||
} // end if $context
|
||||
|
||||
$prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : '';
|
||||
|
||||
@@ -638,8 +638,9 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n";
|
||||
}
|
||||
|
||||
if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )
|
||||
the_excerpt();
|
||||
if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) {
|
||||
echo esc_html( get_the_excerpt() );
|
||||
}
|
||||
|
||||
$actions = array();
|
||||
if ( $can_edit_post && 'trash' != $post->post_status ) {
|
||||
|
||||
@@ -1695,8 +1695,12 @@ class File_Upload_Upgrader {
|
||||
if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
|
||||
wp_die( $uploads['error'] );
|
||||
|
||||
$this->filename = $_GET[$urlholder];
|
||||
$this->filename = sanitize_file_name( $_GET[ $urlholder ] );
|
||||
$this->package = $uploads['basedir'] . '/' . $this->filename;
|
||||
|
||||
if ( 0 !== strpos( realpath( $this->package ), realpath( $uploads['basedir'] ) ) ) {
|
||||
wp_die( __( 'Please select a file' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ class WP_Users_List_Table extends WP_List_Table {
|
||||
$r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>";
|
||||
break;
|
||||
case 'email':
|
||||
$r .= "<td $attributes><a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a></td>";
|
||||
$r .= "<td $attributes><a href='" . esc_url( "mailto:$email" ) . "' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a></td>";
|
||||
break;
|
||||
case 'role':
|
||||
$r .= "<td $attributes>$role_name</td>";
|
||||
|
||||
@@ -429,6 +429,10 @@ function wp_network_dashboard_right_now() {
|
||||
function wp_dashboard_quick_press( $error_msg = false ) {
|
||||
global $post_ID;
|
||||
|
||||
if ( ! current_user_can( 'edit_posts' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */
|
||||
$last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID
|
||||
if ( $last_post_id ) {
|
||||
@@ -531,7 +535,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
|
||||
function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
|
||||
$GLOBALS['comment'] =& $comment;
|
||||
|
||||
$comment_post_title = strip_tags(get_the_title( $comment->comment_post_ID ));
|
||||
$comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
|
||||
|
||||
if ( current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
|
||||
$comment_post_url = get_edit_post_link( $comment->comment_post_ID );
|
||||
|
||||
@@ -638,6 +638,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) ) // directory
|
||||
@@ -791,6 +795,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'] );
|
||||
}
|
||||
@@ -1018,14 +1026,28 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
|
||||
$credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => ''));
|
||||
|
||||
$submitted_form = wp_unslash( $_POST );
|
||||
|
||||
// Verify nonce, or unset submitted form field values on failure
|
||||
if ( ! isset( $_POST['_fs_nonce'] ) || ! wp_verify_nonce( $_POST['_fs_nonce'], 'filesystem-credentials' ) ) {
|
||||
unset(
|
||||
$submitted_form['hostname'],
|
||||
$submitted_form['username'],
|
||||
$submitted_form['password'],
|
||||
$submitted_form['public_key'],
|
||||
$submitted_form['private_key'],
|
||||
$submitted_form['connection_type']
|
||||
);
|
||||
}
|
||||
|
||||
// If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
|
||||
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? wp_unslash( $_POST['hostname'] ) : $credentials['hostname']);
|
||||
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? wp_unslash( $_POST['username'] ) : $credentials['username']);
|
||||
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? wp_unslash( $_POST['password'] ) : '');
|
||||
$credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($submitted_form['hostname']) ? $submitted_form['hostname'] : $credentials['hostname']);
|
||||
$credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($submitted_form['username']) ? $submitted_form['username'] : $credentials['username']);
|
||||
$credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($submitted_form['password']) ? $submitted_form['password'] : '');
|
||||
|
||||
// Check to see if we are setting the public/private keys for ssh
|
||||
$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? wp_unslash( $_POST['public_key'] ) : '');
|
||||
$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? wp_unslash( $_POST['private_key'] ) : '');
|
||||
$credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($submitted_form['public_key']) ? $submitted_form['public_key'] : '');
|
||||
$credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($submitted_form['private_key']) ? $submitted_form['private_key'] : '');
|
||||
|
||||
//sanitize the hostname, Some people might pass in odd-data:
|
||||
$credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off
|
||||
@@ -1042,8 +1064,8 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
$credentials['connection_type'] = 'ssh';
|
||||
else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL
|
||||
$credentials['connection_type'] = 'ftps';
|
||||
else if ( !empty($_POST['connection_type']) )
|
||||
$credentials['connection_type'] = wp_unslash( $_POST['connection_type'] );
|
||||
else if ( !empty($submitted_form['connection_type']) )
|
||||
$credentials['connection_type'] = $submitted_form['connection_type'];
|
||||
else if ( !isset($credentials['connection_type']) ) //All else fails (And it's not defaulted to something else saved), Default to FTP
|
||||
$credentials['connection_type'] = 'ftp';
|
||||
|
||||
@@ -1179,11 +1201,14 @@ jQuery(function($){
|
||||
|
||||
<?php
|
||||
foreach ( (array) $extra_fields as $field ) {
|
||||
if ( isset( $_POST[ $field ] ) )
|
||||
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( wp_unslash( $_POST[ $field ] ) ) . '" />';
|
||||
if ( isset( $submitted_form[ $field ] ) )
|
||||
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />';
|
||||
}
|
||||
submit_button( __( 'Proceed' ), 'button', 'upgrade' );
|
||||
?>
|
||||
<p class="request-filesystem-credentials-action-buttons">
|
||||
<?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>
|
||||
<?php submit_button( __( 'Proceed' ), 'button', 'upgrade', false ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
@@ -366,6 +366,12 @@ function wp_read_image_metadata( $file ) {
|
||||
$meta[ $key ] = utf8_encode( $meta[ $key ] );
|
||||
}
|
||||
|
||||
foreach ( $meta as &$value ) {
|
||||
if ( is_string( $value ) ) {
|
||||
$value = wp_kses_post( $value );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the array of meta data read from an image's exif data.
|
||||
*
|
||||
|
||||
@@ -262,7 +262,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||
$url = $file['url'];
|
||||
$type = $file['type'];
|
||||
$file = $file['file'];
|
||||
$title = $name;
|
||||
$title = sanitize_text_field( $name );
|
||||
$content = '';
|
||||
|
||||
if ( preg_match( '#^audio#', $type ) ) {
|
||||
@@ -433,7 +433,7 @@ wp_enqueue_style( 'ie' );
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
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>
|
||||
@@ -2687,8 +2687,11 @@ function edit_form_image_editor( $post ) {
|
||||
<label for="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
|
||||
@@ -2859,7 +2862,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
|
||||
if ( ! empty( $data[$version]['comments'] ) ) {
|
||||
foreach ( $data[$version]['comments'] as $key => $list ) {
|
||||
if ( ! empty( $list ) ) {
|
||||
$metadata[$key] = reset( $list );
|
||||
$metadata[$key] = wp_kses_post( reset( $list ) );
|
||||
// fix bug in byte stream analysis
|
||||
if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
|
||||
$metadata[$key] = 'Cop' . $metadata[$key];
|
||||
|
||||
@@ -403,24 +403,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
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter 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;
|
||||
|
||||
@@ -165,9 +165,37 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_category'] ) ) {
|
||||
$category_object = get_taxonomy( 'category' );
|
||||
if ( ! current_user_can( $category_object->cap->assign_terms ) ) {
|
||||
unset( $post_data['post_category'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $post_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -177,6 +205,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
* @return int Post ID.
|
||||
*/
|
||||
function edit_post( $post_data = null ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( empty($post_data) )
|
||||
$post_data = &$_POST;
|
||||
@@ -233,6 +262,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'] ) )
|
||||
@@ -310,14 +340,26 @@ 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 );
|
||||
}
|
||||
|
||||
add_meta( $post_ID );
|
||||
|
||||
update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
|
||||
|
||||
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( $translated[ $field ] ) ) {
|
||||
$translated[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $translated[ $field ] );
|
||||
}
|
||||
}
|
||||
|
||||
wp_update_post( $translated );
|
||||
}
|
||||
|
||||
// Now that we have an ID we can fix any attachment anchor hrefs
|
||||
_fix_attachment_links( $post_ID );
|
||||
@@ -474,9 +516,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 ] ) ) {
|
||||
@@ -484,14 +526,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 );
|
||||
|
||||
@@ -502,8 +542,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 );
|
||||
@@ -681,9 +721,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;
|
||||
|
||||
@@ -1193,11 +1234,11 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
}
|
||||
|
||||
if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
|
||||
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
|
||||
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . esc_html( $permalink ) . "</span>\n";
|
||||
if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
|
||||
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
|
||||
if ( isset( $view_post ) )
|
||||
$return .= "<span id='view-post-btn'><a href='$permalink' class='button button-small'>$view_post</a></span>\n";
|
||||
$return .= "<span id='view-post-btn'><a href='" . esc_url( $permalink ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||
|
||||
/**
|
||||
* Filter the sample permalink HTML markup.
|
||||
@@ -1228,17 +1269,17 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
|
||||
$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
|
||||
$view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . esc_html( $post_name_abridged ) . '</span>';
|
||||
$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, esc_html( $permalink ) );
|
||||
$view_link = str_replace(array('%pagename%','%postname%'), $post_name, esc_html( $permalink ) );
|
||||
$return = '<strong>' . __('Permalink:') . "</strong>\n";
|
||||
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
|
||||
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
|
||||
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
|
||||
|
||||
if ( isset( $view_post ) ) {
|
||||
$return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||
$return .= "<span id='view-post-btn'><a href='" . esc_url( get_permalink( $post ) ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||
}
|
||||
|
||||
/** This filter is documented in wp-admin/includes/post.php */
|
||||
@@ -1456,7 +1497,7 @@ function _admin_notice_post_locked() {
|
||||
// Allow plugins to prevent some users overriding the post lock
|
||||
if ( $override ) {
|
||||
?>
|
||||
<a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', get_edit_post_link( $post->ID, 'url' ) ) ); ?>"><?php _e('Take over'); ?></a>
|
||||
<a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', wp_nonce_url( get_edit_post_link( $post->ID, 'url' ), 'lock-post_' . $post->ID ) ) ); ?>"><?php _e('Take over'); ?></a>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -1518,6 +1559,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();
|
||||
|
||||
|
||||
@@ -449,7 +449,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'];
|
||||
@@ -969,7 +971,8 @@ final class WP_Screen {
|
||||
|
||||
switch ( $this->id ) {
|
||||
case 'widgets':
|
||||
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||
$nonce = wp_create_nonce( 'widgets-access' );
|
||||
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=' . urlencode( $nonce ) . '">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=' . urlencode( $nonce ) . '">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||
break;
|
||||
default:
|
||||
$this->_screen_settings = '';
|
||||
|
||||
@@ -749,7 +749,7 @@ function page_template_dropdown( $default = '' ) {
|
||||
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>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1437,7 +1437,7 @@ function _draft_or_post_title( $post = 0 ) {
|
||||
$title = get_the_title( $post );
|
||||
if ( empty( $title ) )
|
||||
$title = __( '(no title)' );
|
||||
return $title;
|
||||
return esc_html( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1480,12 +1480,12 @@ wp_enqueue_style( 'colors' );
|
||||
//<![CDATA[
|
||||
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>
|
||||
|
||||
@@ -659,6 +659,9 @@ $_old_files = array(
|
||||
'wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js',
|
||||
'wp-includes/js/tinymce/plugins/paste/pastetext.htm',
|
||||
'wp-includes/js/tinymce/langs/wp-langs.php',
|
||||
// 4.9.2
|
||||
'wp-includes/js/mediaelement/flashmediaelement.swf',
|
||||
'wp-includes/js/mediaelement/silverlightmediaelement.xap',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -1008,9 +1011,16 @@ 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
|
||||
_upgrade_422_remove_genericons();
|
||||
|
||||
// Upgrade DB with separate request
|
||||
/** This filter is documented in wp-admin/includes/update-core.php */
|
||||
apply_filters( 'update_feedback', __( 'Upgrading database…' ) );
|
||||
@@ -1146,3 +1156,68 @@ window.location = 'about.php?updated';
|
||||
exit();
|
||||
}
|
||||
add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
|
||||
|
||||
/**
|
||||
* Cleans up Genericons example files.
|
||||
*
|
||||
* @since 4.2.2
|
||||
*/
|
||||
function _upgrade_422_remove_genericons() {
|
||||
global $wp_theme_directories, $wp_filesystem;
|
||||
|
||||
// A list of the affected files using the filesystem absolute paths.
|
||||
$affected_files = array();
|
||||
|
||||
// Themes
|
||||
foreach ( $wp_theme_directories as $directory ) {
|
||||
$directory = trailingslashit( $directory );
|
||||
$affected_theme_files = _upgrade_422_find_genericons_files_in_folder( $directory );
|
||||
$affected_files = array_merge( $affected_files, $affected_theme_files );
|
||||
}
|
||||
|
||||
// Plugins
|
||||
$plugin_dir = trailingslashit( WP_PLUGIN_DIR );
|
||||
$affected_plugin_files = _upgrade_422_find_genericons_files_in_folder( $plugin_dir );
|
||||
$affected_files = array_merge( $affected_files, $affected_plugin_files );
|
||||
|
||||
foreach ( $affected_files as $file ) {
|
||||
$gen_dir = $wp_filesystem->find_folder( dirname( $file ) . '/' );
|
||||
if ( ! $gen_dir ) {
|
||||
continue;
|
||||
}
|
||||
// The path when the file is accessed via WP_Filesystem may differ in the case of FTP
|
||||
$remote_file = $gen_dir . basename( $file );
|
||||
|
||||
if ( ! $wp_filesystem->exists( $remote_file ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->delete( $remote_file, false, 'f' ) ) {
|
||||
$wp_filesystem->put_contents( $remote_file, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively find Genericons example files in a given folder.
|
||||
*
|
||||
* @ignore
|
||||
* @since 4.2.2
|
||||
*
|
||||
* @param string $directory Directory path. Expects trailingslashed.
|
||||
* @return array
|
||||
*/
|
||||
function _upgrade_422_find_genericons_files_in_folder( $directory ) {
|
||||
|
||||
$files = array();
|
||||
if ( file_exists( "{$directory}example.html" ) && false !== strpos( file_get_contents( "{$directory}example.html" ), '<title>Genericons</title>' ) ) {
|
||||
$files[] = substr( "{$directory}example.html", strlen( $base ) );
|
||||
}
|
||||
|
||||
foreach ( glob( $directory . '*', GLOB_ONLYDIR ) as $dir ) {
|
||||
$dir = trailingslashit( $dir );
|
||||
$files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) );
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
@@ -430,6 +430,9 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 26691 )
|
||||
upgrade_380();
|
||||
|
||||
if ( $wp_current_db_version < 27918 )
|
||||
upgrade_397();
|
||||
|
||||
maybe_disable_link_manager();
|
||||
|
||||
maybe_disable_automattic_widgets();
|
||||
@@ -1270,6 +1273,63 @@ function upgrade_380() {
|
||||
deactivate_plugins( array( 'mp6/mp6.php' ), true );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 3.9.6.
|
||||
*
|
||||
* @since 3.9.6
|
||||
*/
|
||||
function upgrade_396() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 3.9.7.
|
||||
*
|
||||
* @since 3.9.7
|
||||
*/
|
||||
function upgrade_397() {
|
||||
global $wp_current_db_version, $wpdb;
|
||||
|
||||
if ( $wp_current_db_version < 27918 ) {
|
||||
$content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );
|
||||
|
||||
if ( is_wp_error( $content_length ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( false === $content_length ) {
|
||||
$content_length = array(
|
||||
'type' => 'byte',
|
||||
'length' => 65535,
|
||||
);
|
||||
} elseif ( ! is_array( $content_length ) ) {
|
||||
$length = (int) $content_length > 0 ? (int) $content_length : 65535;
|
||||
$content_length = array(
|
||||
'type' => 'byte',
|
||||
'length' => $length
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) {
|
||||
// Sites with malformed DB schemas are on their own.
|
||||
return;
|
||||
}
|
||||
|
||||
$allowed_length = intval( $content_length['length'] ) - 10;
|
||||
|
||||
$comments = $wpdb->get_results(
|
||||
"SELECT `comment_ID` FROM `{$wpdb->comments}`
|
||||
WHERE `comment_date_gmt` > '2015-04-26'
|
||||
AND LENGTH( `comment_content` ) >= {$allowed_length}
|
||||
AND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )"
|
||||
);
|
||||
|
||||
foreach ( $comments as $comment ) {
|
||||
wp_delete_comment( $comment->comment_ID, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute network level changes
|
||||
*
|
||||
|
||||
@@ -56,11 +56,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('input[name="background-position-x"]').change(function(){c.css("background-position",a(this).val()+" top")}),a('input[name="background-repeat"]').change(function(){c.css("background-repeat",a(this).val())}),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('input[name="background-position-x"]').change(function(){c.css("background-position",a(this).val()+" top")}),a('input[name="background-repeat"]').change(function(){c.css("background-repeat",a(this).val())}),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);
|
||||
@@ -309,8 +309,8 @@
|
||||
|
||||
api.HeaderControl = api.Control.extend({
|
||||
ready: function() {
|
||||
this.btnRemove = $('.actions .remove');
|
||||
this.btnNew = $('.actions .new');
|
||||
this.btnRemove = $('#customize-control-header_image .actions .remove');
|
||||
this.btnNew = $('#customize-control-header_image .actions .new');
|
||||
|
||||
_.bindAll(this, 'openMedia', 'removeImage');
|
||||
|
||||
@@ -1004,6 +1004,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Ensure preview nonce is included with every customized request, to allow post data to be read.
|
||||
$.ajaxPrefilter( function injectPreviewNonce( options ) {
|
||||
if ( ! /wp_customize=on/.test( options.data ) ) {
|
||||
return;
|
||||
}
|
||||
options.data += '&' + $.param({
|
||||
customize_preview_nonce: api.settings.nonce.preview
|
||||
});
|
||||
});
|
||||
|
||||
// Refresh the nonces if the preview sends updated nonces over.
|
||||
previewer.bind( 'nonce', function( nonce ) {
|
||||
$.extend( this.nonce, nonce );
|
||||
|
||||
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
@@ -1,7 +1,7 @@
|
||||
/* global ajaxurl */
|
||||
jQuery(function($){
|
||||
$( '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' ) ) {
|
||||
( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
|
||||
@@ -9,10 +9,12 @@ jQuery(function($){
|
||||
} else if ( target.hasClass( 'wp-set-background' ) ) {
|
||||
id = target.data( 'attachment-id' );
|
||||
img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
|
||||
nonceValue = $( '#_wpnonce' ).val() && '';
|
||||
|
||||
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())})});
|
||||
@@ -451,14 +451,14 @@ var wpNavMenu;
|
||||
if ( ! isPrimaryMenuItem ) {
|
||||
thisLink = menuItem.find( '.menus-move-left' ),
|
||||
thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft );
|
||||
thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).css( 'display', 'inline' );
|
||||
thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).text( thisLinkText ).css( 'display', 'inline' );
|
||||
}
|
||||
|
||||
if ( 0 !== position ) {
|
||||
if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) {
|
||||
thisLink = menuItem.find( '.menus-move-right' ),
|
||||
thisLinkText = menus.under.replace( '%s', prevItemNameRight );
|
||||
thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).css( 'display', 'inline' );
|
||||
thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).text( thisLinkText ).css( 'display', 'inline' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ var wpNavMenu;
|
||||
title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName );
|
||||
}
|
||||
|
||||
$this.prop('title', title).html( title );
|
||||
$this.prop('title', title).text( title );
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1025,7 +1025,7 @@ jQuery(document).ready( function($) {
|
||||
|
||||
if ( mce ) {
|
||||
editor.focus();
|
||||
toolbarHeight = $( '#wp-content-editor-container .mce-toolbar-grp' ).height();
|
||||
toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
|
||||
|
||||
if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
|
||||
toolbarHeight = 30;
|
||||
|
||||
2
wp-admin/js/post.min.js
vendored
2
wp-admin/js/post.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>
|
||||
|
||||
@@ -237,7 +237,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
|
||||
<td>
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo esc_attr( get_site_option('first_comment_author') ); ?>" />
|
||||
<p class="description">
|
||||
<?php _e( 'The author of the first comment on a new site.' ) ?>
|
||||
</p>
|
||||
|
||||
@@ -178,7 +178,7 @@ require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
||||
|
||||
<script type='text/javascript'>
|
||||
/* <![CDATA[ */
|
||||
var current_site_id = <?php echo $id; ?>;
|
||||
var current_site_id = <?php echo absint( $id ); ?>;
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
|
||||
@@ -95,9 +95,9 @@ default:
|
||||
wp_die( $error );
|
||||
|
||||
if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network($file) ) || ! is_plugin_active($file) )
|
||||
activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error
|
||||
activate_plugin($file, "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&a=te&scrollto=$scrollto") );
|
||||
wp_redirect( self_admin_url("plugin-editor.php?file=" . urlencode( $file ) . "&a=te&scrollto=$scrollto") );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@ default:
|
||||
<big><?php
|
||||
if ( is_plugin_active($plugin) ) {
|
||||
if ( is_writeable($real_file) )
|
||||
echo sprintf(__('Editing <strong>%s</strong> (active)'), $file);
|
||||
echo sprintf(__('Editing <strong>%s</strong> (active)'), esc_html( $file ) );
|
||||
else
|
||||
echo sprintf(__('Browsing <strong>%s</strong> (active)'), $file);
|
||||
echo sprintf(__('Browsing <strong>%s</strong> (active)'), esc_html( $file ) );
|
||||
} else {
|
||||
if ( is_writeable($real_file) )
|
||||
echo sprintf(__('Editing <strong>%s</strong> (inactive)'), $file);
|
||||
echo sprintf(__('Editing <strong>%s</strong> (inactive)'), esc_html( $file ) );
|
||||
else
|
||||
echo sprintf(__('Browsing <strong>%s</strong> (inactive)'), $file);
|
||||
echo sprintf(__('Browsing <strong>%s</strong> (inactive)'), esc_html( $file ) );
|
||||
}
|
||||
?></big>
|
||||
</div>
|
||||
@@ -234,7 +234,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($_REQUEST['s']) : '';
|
||||
|
||||
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
|
||||
@@ -37,10 +37,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 {
|
||||
@@ -67,7 +67,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 ) {
|
||||
@@ -107,9 +107,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();
|
||||
|
||||
@@ -181,7 +181,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' );
|
||||
@@ -213,7 +213,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;
|
||||
@@ -225,6 +225,14 @@ if ( $action ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Bail on all if any paths are invalid.
|
||||
// validate_file() returns truthy for invalid files
|
||||
$invalid_plugin_files = array_filter( $plugins, 'validate_file' );
|
||||
if ( $invalid_plugin_files ) {
|
||||
wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
|
||||
exit;
|
||||
}
|
||||
|
||||
include(ABSPATH . 'wp-admin/update.php');
|
||||
|
||||
$parent_file = 'plugins.php';
|
||||
|
||||
@@ -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'];
|
||||
@@ -82,6 +84,10 @@ function redirect_post($post_id = '') {
|
||||
exit;
|
||||
}
|
||||
|
||||
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'] )
|
||||
@@ -113,8 +119,9 @@ case 'post-quickdraft-save':
|
||||
if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
|
||||
$error_msg = __( 'Unable to submit this form, please refresh and try again.' );
|
||||
|
||||
if ( ! current_user_can( 'edit_posts' ) )
|
||||
$error_msg = __( 'Oops, you don’t have access to add new drafts.' );
|
||||
if ( ! current_user_can( 'edit_posts' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $error_msg )
|
||||
return wp_dashboard_quick_press( $error_msg );
|
||||
@@ -159,6 +166,7 @@ case 'edit':
|
||||
wp_die( __( 'You can’t edit this item because it is in the Trash. Please restore it and try again.' ) );
|
||||
|
||||
if ( ! empty( $_GET['get-post-lock'] ) ) {
|
||||
check_admin_referer( 'lock-post_' . $post_id );
|
||||
wp_set_post_lock( $post_id );
|
||||
wp_redirect( get_edit_post_link( $post_id, 'url' ) );
|
||||
exit();
|
||||
@@ -221,7 +229,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 );
|
||||
|
||||
|
||||
@@ -32,8 +32,25 @@ function press_it() {
|
||||
if ( !current_user_can('edit_post', $post_ID) )
|
||||
wp_die(__('You are not allowed to edit this post.'));
|
||||
|
||||
$post['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : '';
|
||||
$post['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : '';
|
||||
// Only accept categories if the user actually can assign
|
||||
$category_tax = get_taxonomy( 'category' );
|
||||
if ( current_user_can( $category_tax->cap->assign_terms ) ) {
|
||||
$post['post_category'] = ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array();
|
||||
}
|
||||
|
||||
// Only accept taxonomies if the user can actually assign
|
||||
if ( ! empty( $_POST['tax_input'] ) ) {
|
||||
$tax_input = $_POST['tax_input'];
|
||||
foreach ( $tax_input as $tax => $_ti ) {
|
||||
$tax_object = get_taxonomy( $tax );
|
||||
if ( ! $tax_object || ! current_user_can( $tax_object->cap->assign_terms ) ) {
|
||||
unset( $tax_input[ $tax ] );
|
||||
}
|
||||
}
|
||||
|
||||
$post['tax_input'] = $tax_input;
|
||||
}
|
||||
|
||||
$post['post_title'] = isset($_POST['title']) ? $_POST['title'] : '';
|
||||
$content = isset($_POST['content']) ? $_POST['content'] : '';
|
||||
|
||||
@@ -63,7 +80,7 @@ function press_it() {
|
||||
// error handling for media_sideload
|
||||
if ( is_wp_error($upload) ) {
|
||||
wp_delete_post($post_ID);
|
||||
wp_die($upload);
|
||||
wp_die( esc_html( $upload->get_error_message() ) );
|
||||
} else {
|
||||
// Post formats
|
||||
if ( isset( $_POST['post_format'] ) ) {
|
||||
@@ -512,75 +529,81 @@ $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $tax = get_taxonomy( 'category' ); ?>
|
||||
<div id="categorydiv" class="postbox">
|
||||
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
|
||||
<h3 class="hndle"><?php _e('Categories') ?></h3>
|
||||
<div class="inside">
|
||||
<div id="taxonomy-category" class="categorydiv">
|
||||
<?php
|
||||
|
||||
<ul id="category-tabs" class="category-tabs">
|
||||
<li class="tabs"><a href="#category-all"><?php echo $tax->labels->all_items; ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#category-pop"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
$tax = get_taxonomy( 'category' );
|
||||
if ( current_user_can( $tax->cap->assign_terms ) ) :
|
||||
?>
|
||||
<div id="categorydiv" class="postbox">
|
||||
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
|
||||
<h3 class="hndle"><?php _e('Categories') ?></h3>
|
||||
<div class="inside">
|
||||
<div id="taxonomy-category" class="categorydiv">
|
||||
|
||||
<div id="category-pop" class="tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
|
||||
<?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?>
|
||||
<ul id="category-tabs" class="category-tabs">
|
||||
<li class="tabs"><a href="#category-all"><?php echo $tax->labels->all_items; ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#category-pop"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="category-all" class="tabs-panel">
|
||||
<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
|
||||
<?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
|
||||
<p><em><?php _e('You cannot modify this Taxonomy.'); ?></em></p>
|
||||
<?php endif; ?>
|
||||
<?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4>
|
||||
<a id="category-add-toggle" href="#category-add" class="hide-if-no-js">
|
||||
<?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?>
|
||||
</a>
|
||||
</h4>
|
||||
<p id="category-add" class="category-add wp-hidden-child">
|
||||
<label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label>
|
||||
<input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/>
|
||||
<label class="screen-reader-text" for="newcategory_parent">
|
||||
<?php echo $tax->labels->parent_item_colon; ?>
|
||||
</label>
|
||||
<?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?>
|
||||
<input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
|
||||
<?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?>
|
||||
<span id="category-ajax-response"></span>
|
||||
</p>
|
||||
<div id="category-pop" class="tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
|
||||
<?php $popular_ids = wp_popular_terms_checklist( 'category' ); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tagsdiv-post_tag" class="postbox">
|
||||
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
|
||||
<h3><span><?php _e('Tags'); ?></span></h3>
|
||||
<div class="inside">
|
||||
<div class="tagsdiv" id="post_tag">
|
||||
<div class="jaxtag">
|
||||
<label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label>
|
||||
<input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" />
|
||||
<div class="ajaxtag">
|
||||
<input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
|
||||
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" />
|
||||
<div id="category-all" class="tabs-panel">
|
||||
<ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
|
||||
<?php wp_terms_checklist($post_ID, array( 'taxonomy' => 'category', 'popular_cats' => $popular_ids ) ) ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4>
|
||||
<a id="category-add-toggle" href="#category-add" class="hide-if-no-js">
|
||||
<?php printf( __( '+ %s' ), $tax->labels->add_new_item ); ?>
|
||||
</a>
|
||||
</h4>
|
||||
<p id="category-add" class="category-add wp-hidden-child">
|
||||
<label class="screen-reader-text" for="newcategory"><?php echo $tax->labels->add_new_item; ?></label>
|
||||
<input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="<?php echo esc_attr( $tax->labels->new_item_name ); ?>" aria-required="true"/>
|
||||
<label class="screen-reader-text" for="newcategory_parent">
|
||||
<?php echo $tax->labels->parent_item_colon; ?>
|
||||
</label>
|
||||
<?php wp_dropdown_categories( array( 'taxonomy' => 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —' ) ); ?>
|
||||
<input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" />
|
||||
<?php wp_nonce_field( 'add-category', '_ajax_nonce-add-category', false ); ?>
|
||||
<span id="category-ajax-response"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tagchecklist"></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags'); ?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
$tax = get_taxonomy( 'post_tag' );
|
||||
if ( current_user_can( $tax->cap->assign_terms ) ) :
|
||||
?>
|
||||
<div id="tagsdiv-post_tag" class="postbox">
|
||||
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
|
||||
<h3><span><?php _e('Tags'); ?></span></h3>
|
||||
<div class="inside">
|
||||
<div class="tagsdiv" id="post_tag">
|
||||
<div class="jaxtag">
|
||||
<label class="screen-reader-text" for="newtag"><?php _e('Tags'); ?></label>
|
||||
<input type="hidden" name="tax_input[post_tag]" class="the-tags" id="tax-input[post_tag]" value="" />
|
||||
<div class="ajaxtag">
|
||||
<input type="text" name="newtag[post_tag]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
|
||||
<input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="tagchecklist"></div>
|
||||
</div>
|
||||
<p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags'); ?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="posting">
|
||||
|
||||
@@ -63,7 +63,7 @@ default :
|
||||
if ( ! $post = get_post( $revision->post_parent ) )
|
||||
break;
|
||||
|
||||
if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'read_post', $post->ID ) )
|
||||
if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) )
|
||||
break;
|
||||
|
||||
// Revisions disabled and we're not looking at an autosave
|
||||
|
||||
@@ -68,7 +68,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;
|
||||
}
|
||||
|
||||
@@ -127,10 +127,12 @@ default:
|
||||
<div id="message" class="updated"><p><?php _e( 'File edited successfully.' ) ?></p></div>
|
||||
<?php endif;
|
||||
|
||||
$description = get_file_description( $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">
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
@@ -179,9 +181,9 @@ if ( $allowed_files ) :
|
||||
if ( 'style.css' == $filename )
|
||||
echo "\t</ul>\n\t<h3>" . _x( 'Styles', 'Theme stylesheets in theme editor' ) . "</h3>\n\t<ul>\n";
|
||||
|
||||
$file_description = get_file_description( $absolute_filename );
|
||||
$file_description = esc_html( get_file_description( $filename ) );
|
||||
if ( $file_description != basename( $filename ) )
|
||||
$file_description .= '<br /><span class="nonessential">(' . $filename . ')</span>';
|
||||
$file_description .= '<br /><span class="nonessential">(' . esc_html( $filename ) . ')</span>';
|
||||
|
||||
if ( $absolute_filename == $file )
|
||||
$file_description = '<span class="highlight">' . $file_description . '</span>';
|
||||
|
||||
@@ -251,7 +251,7 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
|
||||
foreach ( $broken_themes as $broken_theme ) {
|
||||
echo "
|
||||
<tr>
|
||||
<td>" . ( $broken_theme->get( 'Name' ) ? $broken_theme->get( 'Name' ) : $broken_theme->get_stylesheet() ) . "</td>
|
||||
<td>" . ( $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ) ) . "</td>
|
||||
<td>" . $broken_theme->errors()->get_error_message() . "</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
@@ -238,6 +238,8 @@ function list_plugin_updates() {
|
||||
<tbody class="plugins">
|
||||
<?php
|
||||
foreach ( (array) $plugins as $plugin_file => $plugin_data) {
|
||||
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
|
||||
|
||||
$info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
|
||||
// Get plugin compat for running version of WordPress.
|
||||
if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {
|
||||
|
||||
@@ -98,7 +98,7 @@ if ( is_multisite()
|
||||
// Execute confirmed email change. See send_confirmation_on_profile_email().
|
||||
if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
|
||||
$new_email = get_option( $current_user->ID . '_new_email' );
|
||||
if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
|
||||
if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) {
|
||||
$user = new stdClass;
|
||||
$user->ID = $current_user->ID;
|
||||
$user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) );
|
||||
@@ -109,7 +109,8 @@ if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $c
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
}
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) {
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
|
||||
check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
|
||||
delete_option( $current_user->ID . '_new_email' );
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
@@ -201,7 +202,7 @@ include (ABSPATH . 'wp-admin/admin-header.php');
|
||||
<p><strong><?php _e('User updated.') ?></strong></p>
|
||||
<?php endif; ?>
|
||||
<?php if ( $wp_http_referer && !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; ?>
|
||||
@@ -406,7 +407,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
|
||||
$new_email = get_option( $current_user->ID . '_new_email' );
|
||||
if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
|
||||
<div class="updated inline">
|
||||
<p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>
|
||||
<p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), esc_html( $new_email['newemail'] ), esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ) ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
@@ -72,7 +72,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-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();
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
$menu[2] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
|
||||
$menu[2] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard');
|
||||
|
||||
$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );
|
||||
|
||||
$menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
|
||||
$menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
|
||||
|
||||
$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ if ( ! current_user_can('edit_theme_options') )
|
||||
|
||||
$widgets_access = get_user_setting( 'widgets_access' );
|
||||
if ( isset($_GET['widgets-access']) ) {
|
||||
check_admin_referer( 'widgets-access' );
|
||||
|
||||
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
|
||||
set_user_setting( 'widgets_access', $widgets_access );
|
||||
}
|
||||
|
||||
@@ -108,6 +108,8 @@ if ( $user->exists() ) {
|
||||
) {
|
||||
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,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Eleven 1.7\n"
|
||||
"Project-Id-Version: Twenty Eleven 1.8\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentyeleven\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:24+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:26:59+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -431,11 +431,11 @@ msgid ""
|
||||
"in <a href=\"%6$s\" title=\"Return to %7$s\" rel=\"gallery\">%8$s</a>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-options.php:56 inc/theme-options.php:530
|
||||
#: inc/theme-options.php:56 inc/theme-options.php:528
|
||||
msgid "Color Scheme"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-options.php:62 inc/theme-options.php:547
|
||||
#: inc/theme-options.php:62 inc/theme-options.php:545
|
||||
msgid "Link Color"
|
||||
msgstr ""
|
||||
|
||||
@@ -534,40 +534,40 @@ msgstr ""
|
||||
msgid "%s Theme Options"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-options.php:554
|
||||
#: inc/theme-options.php:552
|
||||
msgid "Layout"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:23
|
||||
#: inc/widgets.php:21
|
||||
msgid ""
|
||||
"Use this widget to list your recent Aside, Status, Quote, and Link posts"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:24
|
||||
#: inc/widgets.php:22
|
||||
msgid "Twenty Eleven Ephemera"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:59
|
||||
#: inc/widgets.php:56
|
||||
msgid "Ephemera"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:98 inc/widgets.php:107
|
||||
#: inc/widgets.php:95 inc/widgets.php:104
|
||||
msgid "0 <span class=\"reply\">comments →</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:98 inc/widgets.php:107
|
||||
#: inc/widgets.php:95 inc/widgets.php:104
|
||||
msgid "1 <span class=\"reply\">comment →</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:98 inc/widgets.php:107
|
||||
#: inc/widgets.php:95 inc/widgets.php:104
|
||||
msgid "% <span class=\"reply\">comments →</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:170
|
||||
#: inc/widgets.php:167
|
||||
msgid "Title:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:173
|
||||
#: inc/widgets.php:170
|
||||
msgid "Number of posts to show:"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentyeleven
|
||||
Author: the WordPress team
|
||||
Author URI: http://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: 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: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Fourteen 1.0\n"
|
||||
"Project-Id-Version: Twenty Fourteen 1.1\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentyfourteen\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:26+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:29:37+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -85,19 +85,19 @@ msgstr ""
|
||||
|
||||
#: content-aside.php:37 content-audio.php:37 content-gallery.php:37
|
||||
#: content-image.php:37 content-link.php:37 content-quote.php:37
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:185
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:194
|
||||
msgid "Leave a comment"
|
||||
msgstr ""
|
||||
|
||||
#: content-aside.php:37 content-audio.php:37 content-gallery.php:37
|
||||
#: content-image.php:37 content-link.php:37 content-quote.php:37
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:185
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:194
|
||||
msgid "1 Comment"
|
||||
msgstr ""
|
||||
|
||||
#: content-aside.php:37 content-audio.php:37 content-gallery.php:37
|
||||
#: content-image.php:37 content-link.php:37 content-quote.php:37
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:185
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:194
|
||||
msgid "% Comments"
|
||||
msgstr ""
|
||||
|
||||
@@ -110,7 +110,7 @@ msgstr ""
|
||||
|
||||
#: content-aside.php:46 content-audio.php:46 content-gallery.php:46
|
||||
#: content-image.php:46 content-link.php:46 content-quote.php:46
|
||||
#: content-video.php:46 content.php:54 inc/widgets.php:118 inc/widgets.php:163
|
||||
#: content-video.php:46 content.php:54 inc/widgets.php:127 inc/widgets.php:172
|
||||
msgid "Continue reading <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
@@ -159,50 +159,50 @@ msgstr ""
|
||||
msgid "Secondary menu in left sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:175
|
||||
#: functions.php:171
|
||||
msgid "Primary Sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:177
|
||||
#: functions.php:173
|
||||
msgid "Main sidebar that appears on the left."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:184
|
||||
#: functions.php:180
|
||||
msgid "Content Sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:186
|
||||
#: functions.php:182
|
||||
msgid "Additional sidebar that appears on the right."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:193
|
||||
#: functions.php:189
|
||||
msgid "Footer Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:195
|
||||
#: functions.php:191
|
||||
msgid "Appears in the footer section of the site."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:217
|
||||
#: functions.php:213
|
||||
msgctxt "Lato font: on or off"
|
||||
msgid "on"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:260
|
||||
#: functions.php:254
|
||||
msgid "Previous"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:261
|
||||
#: functions.php:255
|
||||
msgid "Next"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:384
|
||||
#: functions.php:372
|
||||
msgid "%d Article"
|
||||
msgid_plural "%d Articles"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: functions.php:500
|
||||
#: functions.php:488
|
||||
msgid "Page %s"
|
||||
msgstr ""
|
||||
|
||||
@@ -226,7 +226,7 @@ msgstr ""
|
||||
msgid "Next Image"
|
||||
msgstr ""
|
||||
|
||||
#: inc/back-compat.php:41 inc/back-compat.php:53 inc/back-compat.php:68
|
||||
#: inc/back-compat.php:37 inc/back-compat.php:47 inc/back-compat.php:60
|
||||
msgid ""
|
||||
"Twenty Fourteen requires at least WordPress version 3.6. You are running "
|
||||
"version %s. Please upgrade and try again."
|
||||
@@ -244,18 +244,18 @@ msgstr ""
|
||||
msgid "Display Site Title & Tagline"
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:35 inc/featured-content.php:411
|
||||
#: inc/customizer.php:35 inc/featured-content.php:408
|
||||
msgid "Featured Content"
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:36 inc/featured-content.php:412
|
||||
#: inc/customizer.php:36 inc/featured-content.php:409
|
||||
msgid ""
|
||||
"Use a <a href=\"%1$s\">tag</a> to feature your posts. If no posts match the "
|
||||
"tag, <a href=\"%2$s\">sticky posts</a> will be displayed instead."
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:37 inc/customizer.php:104 inc/featured-content.php:413
|
||||
#: inc/featured-content.php:422 inc/featured-content.php:482
|
||||
#: inc/customizer.php:37 inc/customizer.php:102 inc/featured-content.php:410
|
||||
#: inc/featured-content.php:419 inc/featured-content.php:479
|
||||
msgctxt "featured content default tag slug"
|
||||
msgid "featured"
|
||||
msgstr ""
|
||||
@@ -274,20 +274,20 @@ msgstr ""
|
||||
|
||||
#. #-#-#-#-# twentyfourteen.pot (Twenty Fourteen 1.0) #-#-#-#-#
|
||||
#. Theme Name of the plugin/theme
|
||||
#: inc/customizer.php:101
|
||||
#: inc/customizer.php:99
|
||||
msgid "Twenty Fourteen"
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:104
|
||||
#: inc/customizer.php:102
|
||||
msgid ""
|
||||
"The home page features your choice of up to 6 posts prominently displayed in "
|
||||
"a grid or slider, controlled a <a href=\"%1$s\">tag</a>; you can change the "
|
||||
"tag and layout in <a href=\"%2$s\">Appearance → Customize</a>. If no "
|
||||
"posts match the tag, <a href=\"%3$s\">sticky posts</a> will be displayed "
|
||||
"a grid or slider, controlled by a <a href=\"%1$s\">tag</a>; you can change "
|
||||
"the tag and layout in <a href=\"%2$s\">Appearance → Customize</a>. If "
|
||||
"no posts match the tag, <a href=\"%3$s\">sticky posts</a> will be displayed "
|
||||
"instead."
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:105
|
||||
#: inc/customizer.php:103
|
||||
msgid ""
|
||||
"Enhance your site design by using <a href=\"%s\">Featured Images</a> for "
|
||||
"posts you’d like to stand out (also known as post thumbnails). This "
|
||||
@@ -296,110 +296,139 @@ msgid ""
|
||||
"title—and in the Featured Content area on the home page."
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:106
|
||||
#: inc/customizer.php:104
|
||||
msgid ""
|
||||
"For an in-depth tutorial, and more tips and tricks, visit the <a href=\"%s"
|
||||
"\">Twenty Fourteen documentation</a>."
|
||||
msgstr ""
|
||||
|
||||
#: inc/featured-content.php:434
|
||||
#: inc/featured-content.php:431
|
||||
msgid "Tag Name"
|
||||
msgstr ""
|
||||
|
||||
#: inc/featured-content.php:439
|
||||
#: inc/featured-content.php:436
|
||||
msgid "Don’t display tag on front end."
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:47
|
||||
#: inc/template-tags.php:45
|
||||
msgid "← Previous"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:48
|
||||
#: inc/template-tags.php:46
|
||||
msgid "Next →"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:55
|
||||
#: inc/template-tags.php:53
|
||||
msgid "Posts navigation"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:84
|
||||
#: inc/template-tags.php:80
|
||||
msgid "Post navigation"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:88
|
||||
#: inc/template-tags.php:84
|
||||
msgid "<span class=\"meta-nav\">Published In</span>%title"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:90
|
||||
#: inc/template-tags.php:86
|
||||
msgid "<span class=\"meta-nav\">Previous Post</span>%title"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:91
|
||||
#: inc/template-tags.php:87
|
||||
msgid "<span class=\"meta-nav\">Next Post</span>%title"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:110
|
||||
#: inc/template-tags.php:104
|
||||
msgid "Sticky"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:44
|
||||
#: inc/widgets.php:34
|
||||
msgid "Twenty Fourteen Ephemera"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:46
|
||||
#: inc/widgets.php:36
|
||||
msgid ""
|
||||
"Use this widget to list your recent Aside, Quote, Video, Audio, Image, "
|
||||
"Gallery, and Link posts."
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:53 taxonomy-post_format.php:30
|
||||
msgid "Asides"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:54 taxonomy-post_format.php:33
|
||||
msgid "Images"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:55 taxonomy-post_format.php:36
|
||||
#: inc/widgets.php:55
|
||||
msgid "More images"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:58 taxonomy-post_format.php:36
|
||||
msgid "Videos"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:56 taxonomy-post_format.php:39
|
||||
#: inc/widgets.php:59
|
||||
msgid "More videos"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:62 taxonomy-post_format.php:39
|
||||
msgid "Audio"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:57 taxonomy-post_format.php:42
|
||||
#: inc/widgets.php:63
|
||||
msgid "More audio"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:66 taxonomy-post_format.php:42
|
||||
msgid "Quotes"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:58 taxonomy-post_format.php:45
|
||||
#: inc/widgets.php:67
|
||||
msgid "More quotes"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:70 taxonomy-post_format.php:45
|
||||
msgid "Links"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:59 taxonomy-post_format.php:48
|
||||
#: inc/widgets.php:71
|
||||
msgid "More links"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:74 taxonomy-post_format.php:48
|
||||
msgid "Galleries"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:153
|
||||
#: inc/widgets.php:75
|
||||
msgid "More galleries"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:79 taxonomy-post_format.php:30
|
||||
msgid "Asides"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:80
|
||||
msgid "More asides"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:162
|
||||
msgid "This gallery contains <a href=\"%1$s\" rel=\"bookmark\">%2$s photo</a>."
|
||||
msgid_plural ""
|
||||
"This gallery contains <a href=\"%1$s\" rel=\"bookmark\">%2$s photos</a>."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: inc/widgets.php:194
|
||||
msgid "More %s <span class=\"meta-nav\">→</span>"
|
||||
#. translators: used with More archives link
|
||||
#: inc/widgets.php:206
|
||||
msgid "%s <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:242
|
||||
#: inc/widgets.php:255
|
||||
msgid "Title:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:245
|
||||
#: inc/widgets.php:258
|
||||
msgid "Number of posts to show:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:248
|
||||
#: inc/widgets.php:261
|
||||
msgid "Post format to show:"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentyfourteen
|
||||
Author: the WordPress team
|
||||
Author URI: http://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.0
|
||||
Version: 1.1
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Thirteen 1.1\n"
|
||||
"Project-Id-Version: Twenty Thirteen 1.2\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentythirteen\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:26+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:28:45+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -179,71 +179,71 @@ msgctxt "Bitter font: on or off"
|
||||
msgid "on"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:220
|
||||
#: functions.php:218
|
||||
msgid "Page %s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:235
|
||||
#: functions.php:231
|
||||
msgid "Main Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:237
|
||||
#: functions.php:233
|
||||
msgid "Appears in the footer section of the site."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:245
|
||||
#: functions.php:241
|
||||
msgid "Secondary Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:247
|
||||
#: functions.php:243
|
||||
msgid "Appears on posts and pages in the sidebar."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:272
|
||||
#: functions.php:266
|
||||
msgid "Posts navigation"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:276
|
||||
#: functions.php:270
|
||||
msgid "<span class=\"meta-nav\">←</span> Older posts"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:280
|
||||
#: functions.php:274
|
||||
msgid "Newer posts <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:308
|
||||
#: functions.php:300
|
||||
msgid "Post navigation"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:311
|
||||
#: functions.php:303
|
||||
msgctxt "Previous post link"
|
||||
msgid "<span class=\"meta-nav\">←</span> %title"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:312
|
||||
#: functions.php:304
|
||||
msgctxt "Next post link"
|
||||
msgid "%title <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:332
|
||||
#: functions.php:322
|
||||
msgid "Sticky"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: used between list items, there is a space after the comma.
|
||||
#: functions.php:338 functions.php:344
|
||||
#: functions.php:328 functions.php:334
|
||||
msgid ", "
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:353
|
||||
#: functions.php:343
|
||||
msgid "View all posts by %s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:373
|
||||
#: functions.php:363
|
||||
msgctxt "1: post format name. 2: date"
|
||||
msgid "%1$s on %2$s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:379
|
||||
#: functions.php:369
|
||||
msgid "Permalink to %s"
|
||||
msgstr ""
|
||||
|
||||
@@ -278,23 +278,23 @@ msgstr ""
|
||||
msgid "Next <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/back-compat.php:41 inc/back-compat.php:53 inc/back-compat.php:68
|
||||
#: inc/back-compat.php:37 inc/back-compat.php:47 inc/back-compat.php:60
|
||||
msgid ""
|
||||
"Twenty Thirteen requires at least WordPress version 3.6. You are running "
|
||||
"version %s. Please upgrade and try again."
|
||||
msgstr ""
|
||||
|
||||
#: inc/custom-header.php:51
|
||||
#: inc/custom-header.php:49
|
||||
msgctxt "header image description"
|
||||
msgid "Circle"
|
||||
msgstr ""
|
||||
|
||||
#: inc/custom-header.php:56
|
||||
#: inc/custom-header.php:54
|
||||
msgctxt "header image description"
|
||||
msgid "Diamond"
|
||||
msgstr ""
|
||||
|
||||
#: inc/custom-header.php:61
|
||||
#: inc/custom-header.php:59
|
||||
msgctxt "header image description"
|
||||
msgid "Star"
|
||||
msgstr ""
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentythirteen
|
||||
Author: the WordPress team
|
||||
Author URI: http://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: 1.1
|
||||
Version: 1.2
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Twelve 1.3\n"
|
||||
"Project-Id-Version: Twenty Twelve 1.4\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentytwelve\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:25+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:27:55+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -109,7 +109,7 @@ msgstr ""
|
||||
|
||||
#: content-aside.php:26 content-image.php:26 content-link.php:24
|
||||
#: content-page.php:24 content-quote.php:23 content-status.php:40
|
||||
#: content.php:51 functions.php:349 image.php:37
|
||||
#: content.php:51 functions.php:345 image.php:37
|
||||
msgid "Edit"
|
||||
msgstr ""
|
||||
|
||||
@@ -174,95 +174,95 @@ msgctxt "Open Sans font: add new subset (greek, cyrillic, vietnamese)"
|
||||
msgid "no-subset"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:215
|
||||
#: functions.php:213
|
||||
msgid "Page %s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:244
|
||||
#: functions.php:242
|
||||
msgid "Main Sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:246
|
||||
#: functions.php:244
|
||||
msgid ""
|
||||
"Appears on posts and pages except the optional Front Page template, which "
|
||||
"has its own widgets"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:254
|
||||
#: functions.php:252
|
||||
msgid "First Front Page Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:256 functions.php:266
|
||||
#: functions.php:254 functions.php:264
|
||||
msgid ""
|
||||
"Appears when using the optional Front Page template with a page set as "
|
||||
"Static Front Page"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:264
|
||||
#: functions.php:262
|
||||
msgid "Second Front Page Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:288 single.php:20
|
||||
#: functions.php:286 single.php:20
|
||||
msgid "Post navigation"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:289
|
||||
#: functions.php:287
|
||||
msgid "<span class=\"meta-nav\">←</span> Older posts"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:290
|
||||
#: functions.php:288
|
||||
msgid "Newer posts <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:317
|
||||
#: functions.php:313
|
||||
msgid "Pingback:"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:317
|
||||
#: functions.php:313
|
||||
msgid "(Edit)"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:332
|
||||
#: functions.php:328
|
||||
msgid "Post author"
|
||||
msgstr ""
|
||||
|
||||
#. translators: 1: date, 2: time
|
||||
#: functions.php:338
|
||||
#: functions.php:334
|
||||
msgid "%1$s at %2$s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:344
|
||||
#: functions.php:340
|
||||
msgid "Your comment is awaiting moderation."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:353
|
||||
#: functions.php:349
|
||||
msgid "Reply"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: used between list items, there is a space after the comma.
|
||||
#: functions.php:376 functions.php:379
|
||||
#: functions.php:370 functions.php:373
|
||||
msgid ", "
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:390
|
||||
#: functions.php:384
|
||||
msgid "View all posts by %s"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's
|
||||
#. name.
|
||||
#: functions.php:396
|
||||
#: functions.php:390
|
||||
msgid ""
|
||||
"This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author"
|
||||
"\"> by %4$s</span>."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:398
|
||||
#: functions.php:392
|
||||
msgid ""
|
||||
"This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</"
|
||||
"span>."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:400
|
||||
#: functions.php:394
|
||||
msgid "This entry was posted on %3$s<span class=\"by-author\"> by %4$s</span>."
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentytwelve
|
||||
Author: the WordPress team
|
||||
Author URI: http://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: 1.3
|
||||
Version: 1.4
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: light, gray, white, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -519,11 +519,12 @@ class getid3_lib
|
||||
}
|
||||
|
||||
public static function XML2array($XMLstring) {
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
if (function_exists('get_object_vars')) {
|
||||
$XMLobject = simplexml_load_string($XMLstring);
|
||||
return self::SimpleXMLelement2array($XMLobject);
|
||||
}
|
||||
if ( function_exists( 'simplexml_load_string' ) && function_exists( 'libxml_disable_entity_loader' ) ) {
|
||||
$loader = libxml_disable_entity_loader( true );
|
||||
$XMLobject = simplexml_load_string( $XMLstring, 'SimpleXMLElement', LIBXML_NOENT );
|
||||
$return = self::SimpleXMLelement2array( $XMLobject );
|
||||
libxml_disable_entity_loader( $loader );
|
||||
return $return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -587,7 +587,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 ) ) / 1024, 2 ) . 'k )</li>';
|
||||
echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
@@ -1100,8 +1100,10 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
case 'edit_post':
|
||||
case 'edit_page':
|
||||
$post = get_post( $args[0] );
|
||||
if ( empty( $post ) )
|
||||
if ( empty( $post ) ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
break;
|
||||
}
|
||||
|
||||
if ( 'revision' == $post->post_type ) {
|
||||
$post = get_post( $post->post_parent );
|
||||
@@ -1215,7 +1217,16 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
if ( empty( $comment ) )
|
||||
break;
|
||||
$post = get_post( $comment->comment_post_ID );
|
||||
$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
|
||||
|
||||
/*
|
||||
* If the post doesn't exist, we have an orphaned comment.
|
||||
* Fall back to the edit_posts capability, instead.
|
||||
*/
|
||||
if ( $post ) {
|
||||
$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
|
||||
} else {
|
||||
$caps = map_meta_cap( 'edit_posts', $user_id );
|
||||
}
|
||||
break;
|
||||
case 'unfiltered_upload':
|
||||
if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) ) )
|
||||
@@ -1347,21 +1358,25 @@ function current_user_can( $capability ) {
|
||||
* @return bool
|
||||
*/
|
||||
function current_user_can_for_blog( $blog_id, $capability ) {
|
||||
if ( is_multisite() )
|
||||
switch_to_blog( $blog_id );
|
||||
$switched = is_multisite() ? switch_to_blog( $blog_id ) : false;
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
if ( empty( $current_user ) )
|
||||
if ( empty( $current_user ) ) {
|
||||
if ( $switched ) {
|
||||
restore_current_blog();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$args = array_slice( func_get_args(), 2 );
|
||||
$args = array_merge( array( $capability ), $args );
|
||||
|
||||
$can = call_user_func_array( array( $current_user, 'has_cap' ), $args );
|
||||
|
||||
if ( is_multisite() )
|
||||
if ( $switched ) {
|
||||
restore_current_blog();
|
||||
}
|
||||
|
||||
return $can;
|
||||
}
|
||||
|
||||
@@ -203,11 +203,37 @@ class IXR_Message
|
||||
{
|
||||
// first remove the XML declaration
|
||||
// merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
|
||||
$header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr($this->message, 0, 100), 1);
|
||||
$this->message = substr_replace($this->message, $header, 0, 100);
|
||||
if (trim($this->message) == '') {
|
||||
$header = preg_replace( '/<\?xml.*?\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 );
|
||||
$this->message = trim( substr_replace( $this->message, $header, 0, 100 ) );
|
||||
if ( '' == $this->message ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Then remove the DOCTYPE
|
||||
$header = preg_replace( '/^<!DOCTYPE[^>]*+>/i', '', substr( $this->message, 0, 200 ), 1 );
|
||||
$this->message = trim( substr_replace( $this->message, $header, 0, 200 ) );
|
||||
if ( '' == $this->message ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that the root tag is valid
|
||||
$root_tag = substr( $this->message, 0, strcspn( substr( $this->message, 0, 20 ), "> \t\r\n" ) );
|
||||
if ( '<!DOCTYPE' === strtoupper( $root_tag ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( ! in_array( $root_tag, array( '<methodCall', '<methodResponse', '<fault' ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bail if there are too many elements to parse
|
||||
$element_limit = 30000;
|
||||
if ( function_exists( 'apply_filters' ) ) {
|
||||
$element_limit = apply_filters( 'xmlrpc_element_limit', $element_limit );
|
||||
}
|
||||
if ( $element_limit && 2 * $element_limit < substr_count( $this->message, '<' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_parser = xml_parser_create();
|
||||
// Set XML parser to take the case of tags in to account
|
||||
xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
|
||||
|
||||
@@ -214,6 +214,10 @@ class PasswordHash {
|
||||
|
||||
function HashPassword($password)
|
||||
{
|
||||
if ( strlen( $password ) > 4096 ) {
|
||||
return '*';
|
||||
}
|
||||
|
||||
$random = '';
|
||||
|
||||
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
|
||||
@@ -249,6 +253,10 @@ class PasswordHash {
|
||||
|
||||
function CheckPassword($password, $stored_hash)
|
||||
{
|
||||
if ( strlen( $password ) > 4096 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$hash = $this->crypt_private($password, $stored_hash);
|
||||
if ($hash[0] == '*')
|
||||
$hash = crypt($password, $stored_hash);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -999,20 +999,23 @@ class Snoopy
|
||||
if(!empty($this->user) || !empty($this->pass))
|
||||
$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
|
||||
|
||||
for($curr_header = 0; $curr_header < count($headers); $curr_header++) {
|
||||
$safer_header = strtr( $headers[$curr_header], "\"", " " );
|
||||
$cmdline_params .= " -H \"".$safer_header."\"";
|
||||
$headerfile = tempnam( $this->temp_dir, "sno" );
|
||||
$cmdline_params = '-k -D ' . escapeshellarg( $headerfile );
|
||||
|
||||
foreach ( $headers as $header ) {
|
||||
$cmdline_params .= ' -H ' . escapeshellarg( $header );
|
||||
}
|
||||
|
||||
if(!empty($body))
|
||||
$cmdline_params .= " -d \"$body\"";
|
||||
if ( ! empty( $body ) ) {
|
||||
$cmdline_params .= ' -d ' . escapeshellarg( $body );
|
||||
}
|
||||
|
||||
if($this->read_timeout > 0)
|
||||
$cmdline_params .= " -m ".$this->read_timeout;
|
||||
if ( $this->read_timeout > 0 ) {
|
||||
$cmdline_params .= ' -m ' . escapeshellarg( $this->read_timeout );
|
||||
}
|
||||
|
||||
$headerfile = tempnam($this->temp_dir, "sno");
|
||||
|
||||
exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);
|
||||
exec( $this->curl_path . ' ' . $cmdline_params . ' ' . escapeshellarg( $URI ), $results, $return );
|
||||
|
||||
if($return)
|
||||
{
|
||||
|
||||
@@ -163,6 +163,24 @@ final class WP_Customize_Manager {
|
||||
|
||||
$this->theme = wp_get_theme( isset( $_REQUEST['theme'] ) ? $_REQUEST['theme'] : null );
|
||||
|
||||
/*
|
||||
* Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer
|
||||
* application will inject the customize_preview_nonce query parameter into all Ajax requests.
|
||||
* For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out
|
||||
* a user when a valid nonce isn't present.
|
||||
*/
|
||||
$has_post_data_nonce = (
|
||||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false )
|
||||
||
|
||||
check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false )
|
||||
||
|
||||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false )
|
||||
);
|
||||
if ( ! $has_post_data_nonce ) {
|
||||
unset( $_POST['customized'] );
|
||||
unset( $_REQUEST['customized'] );
|
||||
}
|
||||
|
||||
if ( $this->is_theme_active() ) {
|
||||
// Once the theme is loaded, we'll validate it.
|
||||
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
|
||||
|
||||
@@ -1119,22 +1119,19 @@ final class WP_Customize_Widgets {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a widget instance's hash key.
|
||||
* Get MAC for a serialized widget instance string.
|
||||
*
|
||||
* Serialize an instance and hash it with the AUTH_KEY; when a JS value is
|
||||
* posted back to save, this instance hash key is used to ensure that the
|
||||
* serialized_instance was not tampered with, but that it had originated
|
||||
* from WordPress and so is sanitized.
|
||||
* Allows values posted back from JS to be rejected if any tampering of the
|
||||
* data has occurred.
|
||||
*
|
||||
* @since 3.9.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $instance Widget instance.
|
||||
* @return string Widget instance's hash key.
|
||||
* @param string $serialized_instance Widget instance.
|
||||
* @return string MAC for serialized widget instance.
|
||||
*/
|
||||
protected function get_instance_hash_key( $instance ) {
|
||||
$hash = md5( AUTH_KEY . serialize( $instance ) );
|
||||
return $hash;
|
||||
protected function get_instance_hash_key( $serialized_instance ) {
|
||||
return wp_hash( $serialized_instance );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1162,18 +1159,19 @@ final class WP_Customize_Widgets {
|
||||
}
|
||||
|
||||
$decoded = base64_decode( $value['encoded_serialized_instance'], true );
|
||||
|
||||
if ( false === $decoded ) {
|
||||
return null;
|
||||
}
|
||||
$instance = unserialize( $decoded );
|
||||
|
||||
if ( ! hash_equals( $this->get_instance_hash_key( $decoded ), $value['instance_hash_key'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$instance = unserialize( $decoded );
|
||||
if ( false === $instance ) {
|
||||
return null;
|
||||
}
|
||||
if ( $this->get_instance_hash_key( $instance ) !== $value['instance_hash_key'] ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
@@ -1194,7 +1192,7 @@ final class WP_Customize_Widgets {
|
||||
'encoded_serialized_instance' => base64_encode( $serialized ),
|
||||
'title' => empty( $value['title'] ) ? '' : $value['title'],
|
||||
'is_widget_customizer_js_value' => true,
|
||||
'instance_hash_key' => $this->get_instance_hash_key( $value ),
|
||||
'instance_hash_key' => $this->get_instance_hash_key( $serialized ),
|
||||
);
|
||||
}
|
||||
return $value;
|
||||
|
||||
@@ -103,12 +103,6 @@ final class _WP_Editors {
|
||||
// A cookie (set when a user resizes the editor) overrides the height.
|
||||
$cookie = (int) get_user_setting( 'ed_size' );
|
||||
|
||||
// Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
|
||||
if ( ! $cookie && isset( $_COOKIE['TinyMCE_content_size'] ) ) {
|
||||
parse_str( $_COOKIE['TinyMCE_content_size'], $cookie );
|
||||
$cookie = $cookie['ch'];
|
||||
}
|
||||
|
||||
if ( $cookie )
|
||||
$set['editor_height'] = $cookie;
|
||||
}
|
||||
@@ -241,11 +235,11 @@ final class _WP_Editors {
|
||||
|
||||
if ( empty(self::$first_init) ) {
|
||||
if ( is_admin() ) {
|
||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js'), 50 );
|
||||
add_action( 'admin_footer', array( __CLASS__, 'enqueue_scripts'), 1 );
|
||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
|
||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
|
||||
} else {
|
||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js'), 50 );
|
||||
add_action( 'wp_footer', array( __CLASS__, 'enqueue_scripts'), 1 );
|
||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
|
||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class WP_Embed {
|
||||
add_shortcode( 'embed', array( $this, 'shortcode' ) );
|
||||
|
||||
// Do the shortcode (only the [embed] one is registered)
|
||||
$content = do_shortcode( $content );
|
||||
$content = do_shortcode( $content, true );
|
||||
|
||||
// Put the original shortcodes back
|
||||
$shortcode_tags = $orig_shortcode_tags;
|
||||
@@ -291,7 +291,14 @@ class WP_Embed {
|
||||
* @return string Potentially modified $content.
|
||||
*/
|
||||
function autoembed( $content ) {
|
||||
return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
|
||||
// Replace line breaks from all HTML elements with placeholders.
|
||||
$content = wp_replace_in_html_tags( $content, array( "\n" => '<!-- wp-line-break -->' ) );
|
||||
|
||||
// Find URLs that are on their own line.
|
||||
$content = preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
|
||||
|
||||
// Put the line breaks back.
|
||||
return str_replace( '<!-- wp-line-break -->', "\n", $content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -216,7 +216,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
|
||||
$this->headers['Name'] = $this->stylesheet;
|
||||
if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), $this->stylesheet ) );
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
|
||||
else
|
||||
$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
|
||||
$this->template = $this->stylesheet;
|
||||
@@ -263,7 +263,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
$theme_root_template = $directories[ $this->template ]['theme_root'];
|
||||
} else {
|
||||
// Parent theme is missing.
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
$this->parent = new WP_Theme( $this->template, $this->theme_root, $this );
|
||||
return;
|
||||
@@ -275,11 +275,11 @@ final class WP_Theme implements ArrayAccess {
|
||||
// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
|
||||
if ( is_a( $_child, 'WP_Theme' ) && $_child->template == $this->stylesheet ) {
|
||||
$_child->parent = null;
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
|
||||
$_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
|
||||
// The two themes actually reference each other with the Template header.
|
||||
if ( $_child->stylesheet == $this->template ) {
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
}
|
||||
return;
|
||||
@@ -654,8 +654,9 @@ final class WP_Theme implements ArrayAccess {
|
||||
private function markup_header( $header, $value, $translate ) {
|
||||
switch ( $header ) {
|
||||
case 'Name' :
|
||||
if ( empty( $value ) )
|
||||
$value = $this->get_stylesheet();
|
||||
if ( empty( $value ) ) {
|
||||
$value = esc_html( $this->get_stylesheet() );
|
||||
}
|
||||
break;
|
||||
case 'Description' :
|
||||
$value = wptexturize( $value );
|
||||
|
||||
@@ -305,6 +305,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
if ( isset($meta['id']) ) {
|
||||
$meta['id'] = (int) $meta['id'];
|
||||
$pmeta = get_metadata_by_mid( 'post', $meta['id'] );
|
||||
|
||||
if ( ! $pmeta || $pmeta->post_id != $post_id ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset($meta['key']) ) {
|
||||
$meta['key'] = wp_unslash( $meta['key'] );
|
||||
if ( $meta['key'] !== $pmeta->meta_key )
|
||||
@@ -1108,6 +1113,56 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
return $count > 1;
|
||||
}
|
||||
|
||||
private function _validate_boolean( $var ) {
|
||||
if ( is_bool( $var ) ) {
|
||||
return $var;
|
||||
}
|
||||
|
||||
if ( is_string( $var ) && 'false' === strtolower( $var ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) $var;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulate the logic for sticking a post
|
||||
* and determining if the user has permission to do so
|
||||
*
|
||||
* @since 4.3.0
|
||||
* @access private
|
||||
*
|
||||
* @param array $post_data
|
||||
* @param bool $update
|
||||
* @return void|IXR_Error
|
||||
*/
|
||||
private function _toggle_sticky( $post_data, $update = false ) {
|
||||
$post_type = get_post_type_object( $post_data['post_type'] );
|
||||
|
||||
// Private and password-protected posts cannot be stickied.
|
||||
if ( 'private' === $post_data['post_status'] || ! empty( $post_data['post_password'] ) ) {
|
||||
// Error if the client tried to stick the post, otherwise, silently unstick.
|
||||
if ( ! empty( $post_data['sticky'] ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) );
|
||||
}
|
||||
|
||||
if ( $update ) {
|
||||
unstick_post( $post_data['ID'] );
|
||||
}
|
||||
} elseif ( isset( $post_data['sticky'] ) ) {
|
||||
if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );
|
||||
}
|
||||
|
||||
$sticky = $this->_validate_boolean( $post_data['sticky'] );
|
||||
if ( $sticky ) {
|
||||
stick_post( $post_data['ID'] );
|
||||
} else {
|
||||
unstick_post( $post_data['ID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for wp_newPost and wp_editPost, containing shared logic.
|
||||
*
|
||||
@@ -1118,10 +1173,31 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
* @param array $content_struct Post data to insert.
|
||||
*/
|
||||
protected function _insert_post( $user, $content_struct ) {
|
||||
$defaults = array( 'post_status' => 'draft', 'post_type' => 'post', 'post_author' => 0,
|
||||
'post_password' => '', 'post_excerpt' => '', 'post_content' => '', 'post_title' => '' );
|
||||
$defaults = array(
|
||||
'post_status' => 'draft',
|
||||
'post_type' => 'post',
|
||||
'post_author' => null,
|
||||
'post_password' => null,
|
||||
'post_excerpt' => null,
|
||||
'post_content' => null,
|
||||
'post_title' => null,
|
||||
'post_date' => null,
|
||||
'post_date_gmt' => null,
|
||||
'post_format' => null,
|
||||
'post_name' => null,
|
||||
'post_thumbnail' => null,
|
||||
'post_parent' => null,
|
||||
'ping_status' => null,
|
||||
'comment_status' => null,
|
||||
'custom_fields' => null,
|
||||
'terms_names' => null,
|
||||
'terms' => null,
|
||||
'sticky' => null,
|
||||
'enclosure' => null,
|
||||
'ID' => null,
|
||||
);
|
||||
|
||||
$post_data = wp_parse_args( $content_struct, $defaults );
|
||||
$post_data = wp_parse_args( array_intersect_key( $content_struct, $defaults ), $defaults );
|
||||
|
||||
$post_type = get_post_type_object( $post_data['post_type'] );
|
||||
if ( ! $post_type )
|
||||
@@ -1200,20 +1276,9 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
$post_ID = $post_data['ID'];
|
||||
|
||||
if ( $post_data['post_type'] == 'post' ) {
|
||||
// Private and password-protected posts cannot be stickied.
|
||||
if ( $post_data['post_status'] == 'private' || ! empty( $post_data['post_password'] ) ) {
|
||||
// Error if the client tried to stick the post, otherwise, silently unstick.
|
||||
if ( ! empty( $post_data['sticky'] ) )
|
||||
return new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) );
|
||||
if ( $update )
|
||||
unstick_post( $post_ID );
|
||||
} elseif ( isset( $post_data['sticky'] ) ) {
|
||||
if ( ! current_user_can( $post_type->cap->edit_others_posts ) )
|
||||
return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );
|
||||
if ( $post_data['sticky'] )
|
||||
stick_post( $post_ID );
|
||||
else
|
||||
unstick_post( $post_ID );
|
||||
$error = $this->_toggle_sticky( $post_data, $update );
|
||||
if ( $error ) {
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1313,9 +1378,6 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$post_data['tax_input'] = $terms;
|
||||
unset( $post_data['terms'], $post_data['terms_names'] );
|
||||
} else {
|
||||
// do not allow direct submission of 'tax_input', clients must use 'terms' and/or 'terms_names'
|
||||
unset( $post_data['tax_input'], $post_data['post_category'], $post_data['tags_input'] );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_format'] ) ) {
|
||||
@@ -3221,6 +3283,22 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
if ( ! get_post($post_id) )
|
||||
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
|
||||
|
||||
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['comment_post_ID'] = $post_id;
|
||||
|
||||
if ( $logged_in ) {
|
||||
@@ -3543,8 +3621,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 );
|
||||
}
|
||||
@@ -4586,10 +4666,12 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
// Only posts can be sticky
|
||||
if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
|
||||
if ( $content_struct['sticky'] == true )
|
||||
stick_post( $post_ID );
|
||||
elseif ( $content_struct['sticky'] == false )
|
||||
unstick_post( $post_ID );
|
||||
$data = $postdata;
|
||||
$data['sticky'] = $content_struct['sticky'];
|
||||
$error = $this->_toggle_sticky( $data );
|
||||
if ( $error ) {
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($content_struct['custom_fields']) )
|
||||
@@ -4862,11 +4944,12 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
|
||||
|
||||
if ( ('publish' == $post_status) ) {
|
||||
if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
|
||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
|
||||
else if ( !current_user_can('publish_posts') )
|
||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
|
||||
if ( 'publish' == $post_status || 'private' == $post_status ) {
|
||||
if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) );
|
||||
} elseif ( ! current_user_can( 'publish_posts' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $post_more )
|
||||
@@ -4906,10 +4989,13 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
// Only posts can be sticky
|
||||
if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
|
||||
if ( $content_struct['sticky'] == true )
|
||||
stick_post( $post_ID );
|
||||
elseif ( $content_struct['sticky'] == false )
|
||||
unstick_post( $post_ID );
|
||||
$data = $newpost;
|
||||
$data['sticky'] = $content_struct['sticky'];
|
||||
$data['post_type'] = 'post';
|
||||
$error = $this->_toggle_sticky( $data, true );
|
||||
if ( $error ) {
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($content_struct['custom_fields']) )
|
||||
|
||||
@@ -15,7 +15,7 @@ class WP {
|
||||
* @access public
|
||||
* @var array
|
||||
*/
|
||||
var $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', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');
|
||||
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', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' );
|
||||
|
||||
/**
|
||||
* Private query variables.
|
||||
@@ -265,6 +265,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] ) )
|
||||
|
||||
@@ -13,23 +13,141 @@ if ( !function_exists('_') ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists('mb_substr') ):
|
||||
function mb_substr( $str, $start, $length=null, $encoding=null ) {
|
||||
return _mb_substr($str, $start, $length, $encoding);
|
||||
/**
|
||||
* Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.
|
||||
*
|
||||
* @ignore
|
||||
* @since 4.2.2
|
||||
* @access private
|
||||
*
|
||||
* @param bool $set - Used for testing only
|
||||
* null : default - get PCRE/u capability
|
||||
* false : Used for testing - return false for future calls to this function
|
||||
* 'reset': Used for testing - restore default behavior of this function
|
||||
*/
|
||||
function _wp_can_use_pcre_u( $set = null ) {
|
||||
static $utf8_pcre = 'reset';
|
||||
|
||||
if ( null !== $set ) {
|
||||
$utf8_pcre = $set;
|
||||
}
|
||||
|
||||
if ( 'reset' === $utf8_pcre ) {
|
||||
$utf8_pcre = @preg_match( '/^./u', 'a' );
|
||||
}
|
||||
|
||||
return $utf8_pcre;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'mb_substr' ) ) :
|
||||
function mb_substr( $str, $start, $length = null, $encoding = null ) {
|
||||
return _mb_substr( $str, $start, $length, $encoding );
|
||||
}
|
||||
endif;
|
||||
|
||||
function _mb_substr( $str, $start, $length=null, $encoding=null ) {
|
||||
// the solution below, works only for utf-8, so in case of a different
|
||||
// charset, just use built-in substr
|
||||
$charset = get_option( 'blog_charset' );
|
||||
if ( !in_array( $charset, array('utf8', 'utf-8', 'UTF8', 'UTF-8') ) ) {
|
||||
return is_null( $length )? substr( $str, $start ) : substr( $str, $start, $length);
|
||||
/*
|
||||
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
|
||||
* For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
|
||||
* The behavior of this function for invalid inputs is undefined.
|
||||
*/
|
||||
function _mb_substr( $str, $start, $length = null, $encoding = null ) {
|
||||
if ( null === $encoding ) {
|
||||
$encoding = get_option( 'blog_charset' );
|
||||
}
|
||||
// use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
$chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
|
||||
return implode( '', $chars );
|
||||
|
||||
// The solution below works only for UTF-8,
|
||||
// so in case of a different charset just use built-in substr()
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
return is_null( $length ) ? substr( $str, $start ) : substr( $str, $start, $length );
|
||||
}
|
||||
|
||||
if ( _wp_can_use_pcre_u() ) {
|
||||
// Use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
$chars = is_null( $length ) ? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
|
||||
return implode( '', $chars );
|
||||
}
|
||||
|
||||
$regex = '/(
|
||||
[\x00-\x7F] # single-byte sequences 0xxxxxxx
|
||||
| [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
|
||||
| \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2
|
||||
| [\xE1-\xEC][\x80-\xBF]{2}
|
||||
| \xED[\x80-\x9F][\x80-\xBF]
|
||||
| [\xEE-\xEF][\x80-\xBF]{2}
|
||||
| \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3
|
||||
| [\xF1-\xF3][\x80-\xBF]{3}
|
||||
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
||||
)/x';
|
||||
|
||||
$chars = array( '' ); // Start with 1 element instead of 0 since the first thing we do is pop
|
||||
do {
|
||||
// We had some string left over from the last round, but we counted it in that last round.
|
||||
array_pop( $chars );
|
||||
|
||||
// Split by UTF-8 character, limit to 1000 characters (last array element will contain the rest of the string)
|
||||
$pieces = preg_split( $regex, $str, 1000, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
|
||||
|
||||
$chars = array_merge( $chars, $pieces );
|
||||
} while ( count( $pieces ) > 1 && $str = array_pop( $pieces ) ); // If there's anything left over, repeat the loop.
|
||||
|
||||
return join( '', array_slice( $chars, $start, $length ) );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'mb_strlen' ) ) :
|
||||
function mb_strlen( $str, $encoding = null ) {
|
||||
return _mb_strlen( $str, $encoding );
|
||||
}
|
||||
endif;
|
||||
|
||||
/*
|
||||
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
|
||||
* For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
|
||||
* The behavior of this function for invalid inputs is undefined.
|
||||
*/
|
||||
function _mb_strlen( $str, $encoding = null ) {
|
||||
if ( null === $encoding ) {
|
||||
$encoding = get_option( 'blog_charset' );
|
||||
}
|
||||
|
||||
// The solution below works only for UTF-8,
|
||||
// so in case of a different charset just use built-in strlen()
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
return strlen( $str );
|
||||
}
|
||||
|
||||
if ( _wp_can_use_pcre_u() ) {
|
||||
// Use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
return count( $match[0] );
|
||||
}
|
||||
|
||||
$regex = '/(?:
|
||||
[\x00-\x7F] # single-byte sequences 0xxxxxxx
|
||||
| [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
|
||||
| \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2
|
||||
| [\xE1-\xEC][\x80-\xBF]{2}
|
||||
| \xED[\x80-\x9F][\x80-\xBF]
|
||||
| [\xEE-\xEF][\x80-\xBF]{2}
|
||||
| \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3
|
||||
| [\xF1-\xF3][\x80-\xBF]{3}
|
||||
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
||||
)/x';
|
||||
|
||||
$count = 1; // Start at 1 instead of 0 since the first thing we do is decrement
|
||||
do {
|
||||
// We had some string left over from the last round, but we counted it in that last round.
|
||||
$count--;
|
||||
|
||||
// Split by UTF-8 character, limit to 1000 characters (last array element will contain the rest of the string)
|
||||
$pieces = preg_split( $regex, $str, 1000 );
|
||||
|
||||
// Increment
|
||||
$count += count( $pieces );
|
||||
} while ( $str = array_pop( $pieces ) ); // If there's anything left over, repeat the loop.
|
||||
|
||||
// Fencepost: preg_split() always returns one extra item in the array
|
||||
return --$count;
|
||||
}
|
||||
|
||||
if ( !function_exists('hash_hmac') ):
|
||||
@@ -94,3 +212,32 @@ if ( !function_exists('json_decode') ) {
|
||||
return is_array($data) ? array_map(__FUNCTION__, $data) : $data;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'hash_equals' ) ) :
|
||||
/**
|
||||
* Compare two strings in constant time.
|
||||
*
|
||||
* This function was added in PHP 5.6.
|
||||
* It can leak the length of a string.
|
||||
*
|
||||
* @since 3.9.2
|
||||
*
|
||||
* @param string $a Expected string.
|
||||
* @param string $b Actual string.
|
||||
* @return bool Whether strings are equal.
|
||||
*/
|
||||
function hash_equals( $a, $b ) {
|
||||
$a_length = strlen( $a );
|
||||
if ( $a_length !== strlen( $b ) ) {
|
||||
return false;
|
||||
}
|
||||
$result = 0;
|
||||
|
||||
// Do not attempt to "optimize" this.
|
||||
for ( $i = 0; $i < $a_length; $i++ ) {
|
||||
$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
|
||||
}
|
||||
|
||||
return $result === 0;
|
||||
}
|
||||
endif;
|
||||
@@ -279,6 +279,10 @@ div.mce-path {
|
||||
border-color: #bbb;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-listbox span {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.mce-panel .mce-btn i.mce-caret {
|
||||
border-top: 6px solid #777;
|
||||
margin-right: 2px;
|
||||
|
||||
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
@@ -279,6 +279,10 @@ div.mce-path {
|
||||
border-color: #bbb;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-listbox span {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.mce-panel .mce-btn i.mce-caret {
|
||||
border-top: 6px solid #777;
|
||||
margin-left: 2px;
|
||||
|
||||
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
@@ -1781,7 +1781,8 @@
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.media-embed .setting input.hidden {
|
||||
.media-embed .setting input.hidden,
|
||||
.media-embed .setting textarea.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
2
wp-includes/css/media-views-rtl.min.css
vendored
2
wp-includes/css/media-views-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1781,7 +1781,8 @@
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.media-embed .setting input.hidden {
|
||||
.media-embed .setting input.hidden,
|
||||
.media-embed .setting textarea.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
2
wp-includes/css/media-views.min.css
vendored
2
wp-includes/css/media-views.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -732,7 +732,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||
$cache[ $args['widget_id'] ] = ob_get_flush();
|
||||
wp_cache_set( 'widget_recent_posts', $cache, 'widget' );
|
||||
} else {
|
||||
ob_flush();
|
||||
ob_end_flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1343,16 +1343,17 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $title ); ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:'); ?></label>
|
||||
<select id="<?php echo $this->get_field_id('nav_menu'); ?>" name="<?php echo $this->get_field_name('nav_menu'); ?>">
|
||||
<option value="0"><?php _e( '— Select —' ) ?></option>
|
||||
<?php
|
||||
foreach ( $menus as $menu ) {
|
||||
echo '<option value="' . $menu->term_id . '"'
|
||||
. selected( $nav_menu, $menu->term_id, false )
|
||||
. '>'. $menu->name . '</option>';
|
||||
. '>'. esc_html( $menu->name ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
@@ -470,7 +470,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" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -505,7 +505,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" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,14 @@ function wptexturize($text) {
|
||||
$no_texturize_tags_stack = array();
|
||||
$no_texturize_shortcodes_stack = array();
|
||||
|
||||
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
// Look for shortcodes and HTML elements.
|
||||
|
||||
$shortcode_regex =
|
||||
'\[' // Find start of shortcode.
|
||||
. '[^\[\]<>]++' // Shortcodes do not contain other shortcodes. Possessive critical.
|
||||
. '\]'; // Find end of shortcode.
|
||||
|
||||
$textarr = preg_split("/(<[^>]*>|$shortcode_regex)/s", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
foreach ( $textarr as &$curl ) {
|
||||
if ( empty( $curl ) ) {
|
||||
@@ -163,7 +170,7 @@ function wptexturize($text) {
|
||||
$first = $curl[0];
|
||||
if ( '<' === $first ) {
|
||||
_wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
|
||||
} elseif ( '[' === $first ) {
|
||||
} elseif ( '[' === $first && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) {
|
||||
_wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
|
||||
} elseif ( empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack) ) {
|
||||
|
||||
@@ -214,6 +221,8 @@ function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $openi
|
||||
|
||||
array_push($stack, $matches[1]);
|
||||
}
|
||||
} elseif ( 0 == count( $stack ) ) {
|
||||
// Stack is empty. Just stop.
|
||||
} else {
|
||||
// Closing? Check $text+2 against disabled elements
|
||||
$c = preg_quote($closing, '/');
|
||||
@@ -282,6 +291,9 @@ function wpautop($pee, $br = true) {
|
||||
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
|
||||
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
|
||||
|
||||
// Find newlines in all elements and add placeholders.
|
||||
$pee = wp_replace_in_html_tags( $pee, array( "\n" => " <!-- wpnl --> " ) );
|
||||
|
||||
if ( strpos( $pee, '</object>' ) !== false ) {
|
||||
// no P/BR around param and embed
|
||||
$pee = preg_replace( '|(<object[^>]*>)\s*|', '$1', $pee );
|
||||
@@ -327,9 +339,109 @@ function wpautop($pee, $br = true) {
|
||||
if ( !empty($pre_tags) )
|
||||
$pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee);
|
||||
|
||||
// Restore newlines in all elements.
|
||||
$pee = str_replace( " <!-- wpnl --> ", "\n", $pee );
|
||||
|
||||
return $pee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Separate HTML elements and comments from the text.
|
||||
*
|
||||
* @since 4.2.4
|
||||
*
|
||||
* @param string $input The text which has to be formatted.
|
||||
* @return array The formatted text.
|
||||
*/
|
||||
function wp_html_split( $input ) {
|
||||
static $regex;
|
||||
|
||||
if ( ! isset( $regex ) ) {
|
||||
$comments =
|
||||
'!' // Start of comment, after the <.
|
||||
. '(?:' // Unroll the loop: Consume everything until --> is found.
|
||||
. '-(?!->)' // Dash not followed by end of comment.
|
||||
. '[^\-]*+' // Consume non-dashes.
|
||||
. ')*+' // Loop possessively.
|
||||
. '(?:-->)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$cdata =
|
||||
'!\[CDATA\[' // Start of comment, after the <.
|
||||
. '[^\]]*+' // Consume non-].
|
||||
. '(?:' // Unroll the loop: Consume everything until ]]> is found.
|
||||
. '](?!]>)' // One ] not followed by end of comment.
|
||||
. '[^\]]*+' // Consume non-].
|
||||
. ')*+' // Loop possessively.
|
||||
. '(?:]]>)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$regex =
|
||||
'/(' // Capture the entire match.
|
||||
. '<' // Find start of element.
|
||||
. '(?(?=!--)' // Is this a comment?
|
||||
. $comments // Find end of comment.
|
||||
. '|'
|
||||
. '(?(?=!\[CDATA\[)' // Is this a comment?
|
||||
. $cdata // Find end of comment.
|
||||
. '|'
|
||||
. '[^>]*>?' // Find end of element. If not found, match all input.
|
||||
. ')'
|
||||
. ')'
|
||||
. ')/s';
|
||||
}
|
||||
|
||||
return preg_split( $regex, $input, -1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace characters or phrases within HTML elements only.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $haystack The text which has to be formatted.
|
||||
* @param array $replace_pairs In the form array('from' => 'to', ...).
|
||||
* @return string The formatted text.
|
||||
*/
|
||||
function wp_replace_in_html_tags( $haystack, $replace_pairs ) {
|
||||
// Find all elements.
|
||||
$textarr = wp_html_split( $haystack );
|
||||
$changed = false;
|
||||
|
||||
// Optimize when searching for one item.
|
||||
if ( 1 === count( $replace_pairs ) ) {
|
||||
// Extract $needle and $replace.
|
||||
foreach ( $replace_pairs as $needle => $replace );
|
||||
|
||||
// Loop through delimeters (elements) only.
|
||||
for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
|
||||
if ( false !== strpos( $textarr[$i], $needle ) ) {
|
||||
$textarr[$i] = str_replace( $needle, $replace, $textarr[$i] );
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Extract all $needles.
|
||||
$needles = array_keys( $replace_pairs );
|
||||
|
||||
// Loop through delimeters (elements) only.
|
||||
for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
|
||||
foreach ( $needles as $needle ) {
|
||||
if ( false !== strpos( $textarr[$i], $needle ) ) {
|
||||
$textarr[$i] = strtr( $textarr[$i], $replace_pairs );
|
||||
$changed = true;
|
||||
// After one strtr() break out of the foreach loop and look at next element.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $changed ) {
|
||||
$haystack = implode( $textarr );
|
||||
}
|
||||
|
||||
return $haystack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Newline preservation help function for wpautop
|
||||
*
|
||||
@@ -912,7 +1024,8 @@ function remove_accents($string) {
|
||||
* operating systems and special characters requiring special escaping
|
||||
* to manipulate at the command line. Replaces spaces and consecutive
|
||||
* dashes with a single dash. Trims period, dash and underscore from beginning
|
||||
* and end of filename.
|
||||
* and end of filename. It is not guaranteed that this function will return a
|
||||
* filename that is allowed to be uploaded.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
@@ -922,6 +1035,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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the list of characters to remove from a filename.
|
||||
*
|
||||
@@ -931,11 +1062,18 @@ 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 = preg_replace('/[\s-]+/', '-', $filename);
|
||||
$filename = trim($filename, '.-_');
|
||||
|
||||
if ( false === strpos( $filename, '.' ) ) {
|
||||
$mime_types = wp_get_mime_types();
|
||||
$filetype = wp_check_filetype( 'test.' . $filename, $mime_types );
|
||||
if ( $filetype['ext'] === $filename ) {
|
||||
$filename = 'unnamed-file.' . $filetype['ext'];
|
||||
}
|
||||
}
|
||||
|
||||
// Split the filename into a base and extension[s]
|
||||
$parts = explode('.', $filename);
|
||||
|
||||
@@ -1169,21 +1307,23 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures a string is a valid SQL order by clause.
|
||||
* Ensures a string is a valid SQL 'order by' clause.
|
||||
*
|
||||
* Accepts one or more columns, with or without ASC/DESC, and also accepts
|
||||
* RAND().
|
||||
* Accepts one or more columns, with or without a sort order (ASC / DESC).
|
||||
* e.g. 'column_1', 'column_1, column_2', 'column_1 ASC, column_2 DESC' etc.
|
||||
*
|
||||
* Also accepts 'RAND()'.
|
||||
*
|
||||
* @since 2.5.1
|
||||
*
|
||||
* @param string $orderby Order by string to be checked.
|
||||
* @return string|bool Returns the order by clause if it is a match, false otherwise.
|
||||
* @param string $orderby Order by clause to be validated.
|
||||
* @return string|bool Returns $orderby if valid, false otherwise.
|
||||
*/
|
||||
function sanitize_sql_orderby( $orderby ){
|
||||
preg_match('/^\s*([a-z0-9_]+(\s+(ASC|DESC))?(\s*,\s*|\s*$))+|^\s*RAND\(\s*\)\s*$/i', $orderby, $obmatches);
|
||||
if ( !$obmatches )
|
||||
return false;
|
||||
return $orderby;
|
||||
function sanitize_sql_orderby( $orderby ) {
|
||||
if ( preg_match( '/^\s*(([a-z0-9_]+|`[a-z0-9_]+`)(\s+(ASC|DESC))?\s*(,\s*(?=[a-z0-9_`])|$))+$/i', $orderby ) || preg_match( '/^\s*RAND\(\s*\)\s*$/i', $orderby ) ) {
|
||||
return $orderby;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1420,6 +1420,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 ) ) {
|
||||
@@ -1495,18 +1500,38 @@ function path_join( $base, $path ) {
|
||||
/**
|
||||
* Normalize a filesystem path.
|
||||
*
|
||||
* Replaces backslashes with forward slashes for Windows systems,
|
||||
* and ensures no duplicate slashes exist.
|
||||
* On windows systems, replaces backslashes with forward slashes
|
||||
* and forces upper-case drive letters.
|
||||
* Allows for two leading slashes for Windows network shares, but
|
||||
* ensures that all other duplicate slashes are reduced to a single.
|
||||
*
|
||||
* @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 );
|
||||
$path = preg_replace( '|/+|','/', $path );
|
||||
return $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 $wrapper . $path;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1977,7 +2002,7 @@ function wp_check_filetype( $filename, $mimes = null ) {
|
||||
* If it's determined that the extension does not match the file's real type,
|
||||
* then the "proper_filename" value will be set with a proper filename and extension.
|
||||
*
|
||||
* Currently this function only supports validating images known to getimagesize().
|
||||
* Currently this function only supports renaming images validated via wp_get_image_mime().
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
@@ -1998,14 +2023,15 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
if ( ! file_exists( $file ) )
|
||||
return compact( 'ext', 'type', 'proper_filename' );
|
||||
|
||||
// We're able to validate images using GD
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) && function_exists('getimagesize') ) {
|
||||
// Validate image types.
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) ) {
|
||||
|
||||
// Attempt to figure out what type of image it actually is
|
||||
$imgstats = @getimagesize( $file );
|
||||
$real_mime = wp_get_image_mime( $file );
|
||||
|
||||
// If getimagesize() knows what kind of image it really is and if the real MIME doesn't match the claimed MIME
|
||||
if ( !empty($imgstats['mime']) && $imgstats['mime'] != $type ) {
|
||||
if ( ! $real_mime ) {
|
||||
$type = $ext = false;
|
||||
} elseif ( $real_mime != $type ) {
|
||||
/**
|
||||
* Filter the list mapping image mime types to their respective extensions.
|
||||
*
|
||||
@@ -2022,10 +2048,10 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
) );
|
||||
|
||||
// Replace whatever is after the last period in the filename with the correct extension
|
||||
if ( ! empty( $mime_to_ext[ $imgstats['mime'] ] ) ) {
|
||||
if ( ! empty( $mime_to_ext[ $real_mime ] ) ) {
|
||||
$filename_parts = explode( '.', $filename );
|
||||
array_pop( $filename_parts );
|
||||
$filename_parts[] = $mime_to_ext[ $imgstats['mime'] ];
|
||||
$filename_parts[] = $mime_to_ext[ $real_mime ];
|
||||
$new_filename = implode( '.', $filename_parts );
|
||||
|
||||
if ( $new_filename != $filename )
|
||||
@@ -2034,10 +2060,67 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
// Redefine the extension / MIME
|
||||
$wp_filetype = wp_check_filetype( $new_filename, $mimes );
|
||||
extract( $wp_filetype );
|
||||
} else {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Validate files that didn't get validated during previous checks.
|
||||
if ( $type && ! $real_mime && extension_loaded( 'fileinfo' ) ) {
|
||||
$finfo = finfo_open( FILEINFO_MIME_TYPE );
|
||||
$real_mime = finfo_file( $finfo, $file );
|
||||
finfo_close( $finfo );
|
||||
|
||||
// fileinfo often misidentifies obscure files as one of these types
|
||||
$nonspecific_types = array(
|
||||
'application/octet-stream',
|
||||
'application/encrypted',
|
||||
'application/CDFV2-encrypted',
|
||||
'application/zip',
|
||||
);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the "real" file type of the given file.
|
||||
*
|
||||
@@ -2053,6 +2136,38 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the real mime type of an image file.
|
||||
*
|
||||
* This depends on exif_imagetype() or getimagesize() to determine real mime types.
|
||||
*
|
||||
* @since 4.7.1
|
||||
*
|
||||
* @param string $file Full path to the file.
|
||||
* @return string|false The actual mime type or false if the type cannot be determined.
|
||||
*/
|
||||
function wp_get_image_mime( $file ) {
|
||||
/*
|
||||
* Use exif_imagetype() to check the mimetype if available or fall back to
|
||||
* getimagesize() if exif isn't avaialbe. If either function throws an Exception
|
||||
* we assume the file could not be validated.
|
||||
*/
|
||||
try {
|
||||
if ( is_callable( 'exif_imagetype' ) ) {
|
||||
$mime = image_type_to_mime_type( exif_imagetype( $file ) );
|
||||
} elseif ( function_exists( 'getimagesize' ) ) {
|
||||
$imagesize = getimagesize( $file );
|
||||
$mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
|
||||
} else {
|
||||
$mime = false;
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
$mime = false;
|
||||
}
|
||||
|
||||
return $mime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve list of mime types and file extensions.
|
||||
*
|
||||
@@ -2184,8 +2299,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'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter list of allowed mime types and file extensions.
|
||||
@@ -4444,3 +4560,29 @@ function mbstring_binary_safe_encoding( $reset = false ) {
|
||||
function reset_mbstring_encoding() {
|
||||
mbstring_binary_safe_encoding( true );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/** This filter is documented in wp-admin/custom-header.php */
|
||||
$delete = apply_filters( 'wp_delete_file', $file );
|
||||
if ( ! empty( $delete ) ) {
|
||||
@unlink( $delete );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user