Compare commits
179 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cb5beb1be | ||
|
|
00ae10906e | ||
|
|
7bfe4a912f | ||
|
|
229d71e0f8 | ||
|
|
1fcbdb46e6 | ||
|
|
de854c38b5 | ||
|
|
43cac2c9d4 | ||
|
|
561924df40 | ||
|
|
ca92ecbe61 | ||
|
|
9807e138d3 | ||
|
|
ebbc9ff12e | ||
|
|
bc4ed1a93e | ||
|
|
3efe9a5fdb | ||
|
|
aab268600a | ||
|
|
303bd241f3 | ||
|
|
2d9f6ab9dd | ||
|
|
7000d8a45f | ||
|
|
0e98d850b9 | ||
|
|
f91b78ec58 | ||
|
|
61881c7156 | ||
|
|
ef0bb8bab1 | ||
|
|
dac39608a3 | ||
|
|
93cae5c2ab | ||
|
|
581a8a01c7 | ||
|
|
04d983d6c1 | ||
|
|
e74c55ff6d | ||
|
|
507c958ab6 | ||
|
|
4b860b51ae | ||
|
|
ec85529fb7 | ||
|
|
64c1ec2877 | ||
|
|
a8df162eea | ||
|
|
63cc2673a1 | ||
|
|
f345c93563 | ||
|
|
9dadfcb012 | ||
|
|
58880cb8c1 | ||
|
|
eb5a635d04 | ||
|
|
86acf8b033 | ||
|
|
7a5426f3fe | ||
|
|
c4fb8dfbf1 | ||
|
|
a964c2ba2e | ||
|
|
79e0bb13d4 | ||
|
|
be9edc6bc3 | ||
|
|
a59dfc257f | ||
|
|
6ddef3f8ab | ||
|
|
74df39530d | ||
|
|
e7865eb9ae | ||
|
|
ecf502b597 | ||
|
|
a01117bf0d | ||
|
|
7f8136dfd7 | ||
|
|
566df4de1a | ||
|
|
8f47014af6 | ||
|
|
92f3fdb956 | ||
|
|
7fc612abfb | ||
|
|
5565b98dde | ||
|
|
82c9b36ce7 | ||
|
|
b9a98e7562 | ||
|
|
8299a48476 | ||
|
|
db266e95e1 | ||
|
|
2bc231688e | ||
|
|
462631b8cc | ||
|
|
933f556e84 | ||
|
|
f449b0a0ce | ||
|
|
22688ca8c6 | ||
|
|
afc91088f4 | ||
|
|
b7509648b8 | ||
|
|
ab64033700 | ||
|
|
073c7e6092 | ||
|
|
99f9d45c10 | ||
|
|
87912afcf6 | ||
|
|
76d93255d6 | ||
|
|
ed1586d7ff | ||
|
|
4873f1b139 | ||
|
|
516cd7a86c | ||
|
|
9f4a883e2f | ||
|
|
755a765d49 | ||
|
|
8afdd2be32 | ||
|
|
fe2cc48d0e | ||
|
|
e57416e1d7 | ||
|
|
f7adf3c9d2 | ||
|
|
0e5485fe33 | ||
|
|
2c40eb4cf2 | ||
|
|
3042245749 | ||
|
|
754a809bfb | ||
|
|
3c1876e6c5 | ||
|
|
d5a6676eb2 | ||
|
|
437f727e8f | ||
|
|
b4bf158d3a | ||
|
|
569f0c90fc | ||
|
|
0ba49c4a4c | ||
|
|
94306911e2 | ||
|
|
96731bcfb4 | ||
|
|
e35259b0bc | ||
|
|
0986b209ea | ||
|
|
6d9698863c | ||
|
|
a60f6eea61 | ||
|
|
1c4f8827a2 | ||
|
|
080ef55551 | ||
|
|
666b9f8558 | ||
|
|
c1769766f6 | ||
|
|
c30865a6b5 | ||
|
|
c897bed043 | ||
|
|
f26900d209 | ||
|
|
5686506414 | ||
|
|
0c79ef9ef8 | ||
|
|
ca39e38e59 | ||
|
|
629e2b70f7 | ||
|
|
ec4db723d2 | ||
|
|
a4dba03383 | ||
|
|
c8d3901f8f | ||
|
|
56b1ceaf04 | ||
|
|
6b2df3479c | ||
|
|
439841760c | ||
|
|
a4279152fc | ||
|
|
f59f79151e | ||
|
|
e2e6972945 | ||
|
|
b0b028eacd | ||
|
|
fe8fa1b562 | ||
|
|
008c4fe3c4 | ||
|
|
ddf451dbb5 | ||
|
|
5198ab8672 | ||
|
|
373ba799c3 | ||
|
|
ce7113bc3e | ||
|
|
c58e9ddf35 | ||
|
|
371f520a52 | ||
|
|
d8eb8da38a | ||
|
|
68c10bf9e1 | ||
|
|
4cd2612edc | ||
|
|
fe2d10ea5c | ||
|
|
85e880b5b2 | ||
|
|
0f9cb9ce20 | ||
|
|
78fc515bf3 | ||
|
|
9a74f7c01a | ||
|
|
22e22a3db7 | ||
|
|
020f33ba74 | ||
|
|
72a321196e | ||
|
|
0300e1f14a | ||
|
|
8429597071 | ||
|
|
722c40dda7 | ||
|
|
c4faea356b | ||
|
|
78b8290b7a | ||
|
|
c33661c857 | ||
|
|
3f40fe30a8 | ||
|
|
b6058e2231 | ||
|
|
8e96288144 | ||
|
|
19aa985476 | ||
|
|
c43baf9ef4 | ||
|
|
7090cf8980 | ||
|
|
63f64d5909 | ||
|
|
61122743e2 | ||
|
|
371db8aea1 | ||
|
|
cf02c02024 | ||
|
|
ca13bd76d5 | ||
|
|
1ee5e6c4dd | ||
|
|
ba2de1e736 | ||
|
|
ff4c5d2767 | ||
|
|
599782db47 | ||
|
|
e1f9360463 | ||
|
|
fc3a071185 | ||
|
|
f3d41b7b38 | ||
|
|
e568d1e4b7 | ||
|
|
ca97837cf3 | ||
|
|
0baf141106 | ||
|
|
80d7ad721a | ||
|
|
5c01870b62 | ||
|
|
5d957b7c84 | ||
|
|
8c578f0e0c | ||
|
|
b0b230fab4 | ||
|
|
568c4e8f56 | ||
|
|
db8f915ee6 | ||
|
|
c08ee82b3c | ||
|
|
6f00d59589 | ||
|
|
897691addd | ||
|
|
be8bdfb795 | ||
|
|
4202e36193 | ||
|
|
a3a76fe665 | ||
|
|
5c2b420b29 | ||
|
|
f0a9d2e5a1 | ||
|
|
ca542b5d18 | ||
|
|
865b9a613e |
@@ -1,6 +1,6 @@
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2015 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 4.2
|
||||
</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 {
|
||||
$url = isset( $result['blog_id'] ) ? get_blogaddress_by_id( (int) $result['blog_id'] ) : '';
|
||||
$user = get_userdata( (int) $result['user_id'] );
|
||||
|
||||
@@ -40,6 +40,183 @@ 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', 25 ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed one security issue.' ),
|
||||
'4.2.26'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.2.26' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.2.25'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.2.25' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed some security issues.' ),
|
||||
'4.2.24'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.2.24' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress version number */
|
||||
__( '<strong>Version %s</strong> addressed a security issue.' ),
|
||||
'4.2.23'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '4.2.23' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: WordPress version number */
|
||||
printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '4.2.22' );
|
||||
?>
|
||||
<?php
|
||||
/* translators: %s: Codex URL */
|
||||
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.22' );
|
||||
?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '4.2.21' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.21' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '4.2.20' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.20' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '4.2.19' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.19' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 4 ), '4.2.18' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.18' ); ?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed one security issue.' ), '4.2.17' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.17' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 8 ), '4.2.16' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.16' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 5 ), '4.2.15' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.15' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '4.2.14', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.14' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '4.2.13' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.13' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 3 ), '4.2.12' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.12' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 8 ), '4.2.11' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.11' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 1 ), '4.2.10', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.10' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 9 ), '4.2.9' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.9' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '4.2.8' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.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 ), '4.2.7' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.7' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '4.2.6' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.6' ); ?>
|
||||
</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 ), '4.2.5', number_format_i18n( 2 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.5' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 4 ), '4.2.4', number_format_i18n( 4 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.4' ); ?>
|
||||
</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.', 20 ), '4.2.3', number_format_i18n( 20 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.3' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 13 ), '4.2.2', number_format_i18n( 13 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.2' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '4.2.1' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.2.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="headline-feature feature-video">
|
||||
<embed type="application/x-shockwave-flash" src="https://v0.wordpress.com/player.swf?v=1.04" width="1000" height="560" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=e9kH4FzP&isDynamicSeeking=true"></embed>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@ if ( ! ( isset( $_REQUEST['action'] ) && 'upload-attachment' == $_REQUEST['actio
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin.php' );
|
||||
|
||||
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
||||
header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
|
||||
|
||||
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
|
||||
include( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
|
||||
2
wp-admin/css/deprecated-media-rtl.min.css
vendored
2
wp-admin/css/deprecated-media-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/deprecated-media.min.css
vendored
2
wp-admin/css/deprecated-media.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -545,6 +545,7 @@ span.wp-media-buttons-icon:before {
|
||||
.notification-dialog {
|
||||
position: fixed;
|
||||
top: 30%;
|
||||
max-height: 70%;
|
||||
right: 50%;
|
||||
width: 450px;
|
||||
margin-right: -225px;
|
||||
@@ -553,6 +554,7 @@ span.wp-media-buttons-icon:before {
|
||||
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
|
||||
line-height: 1.5;
|
||||
z-index: 1000005;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.notification-dialog-background {
|
||||
|
||||
@@ -545,6 +545,7 @@ span.wp-media-buttons-icon:before {
|
||||
.notification-dialog {
|
||||
position: fixed;
|
||||
top: 30%;
|
||||
max-height: 70%;
|
||||
left: 50%;
|
||||
width: 450px;
|
||||
margin-left: -225px;
|
||||
@@ -553,6 +554,7 @@ span.wp-media-buttons-icon:before {
|
||||
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
|
||||
line-height: 1.5;
|
||||
z-index: 1000005;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.notification-dialog-background {
|
||||
|
||||
@@ -862,6 +862,7 @@ table.form-table td .updated p {
|
||||
|
||||
.request-filesystem-credentials-dialog .notification-dialog {
|
||||
top: 15%;
|
||||
max-height: 85%;
|
||||
}
|
||||
|
||||
.request-filesystem-credentials-dialog-content {
|
||||
@@ -1157,11 +1158,11 @@ table.form-table td .updated p {
|
||||
.request-filesystem-credentials-dialog .notification-dialog{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
margin: 0;
|
||||
right: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -862,6 +862,7 @@ table.form-table td .updated p {
|
||||
|
||||
.request-filesystem-credentials-dialog .notification-dialog {
|
||||
top: 15%;
|
||||
max-height: 85%;
|
||||
}
|
||||
|
||||
.request-filesystem-credentials-dialog-content {
|
||||
@@ -1157,11 +1158,11 @@ table.form-table td .updated p {
|
||||
.request-filesystem-credentials-dialog .notification-dialog{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
margin: 0;
|
||||
left: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
wp-admin/css/install-rtl.min.css
vendored
2
wp-admin/css/install-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/install.min.css
vendored
2
wp-admin/css/install.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login-rtl.min.css
vendored
2
wp-admin/css/login-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login.min.css
vendored
2
wp-admin/css/login.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -846,6 +846,7 @@ input[type="search"].categories-search,
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
font-size: 14px;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
|
||||
2
wp-admin/css/press-this-rtl.min.css
vendored
2
wp-admin/css/press-this-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -846,6 +846,7 @@ input[type="search"].categories-search,
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
font-size: 14px;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
|
||||
2
wp-admin/css/press-this.min.css
vendored
2
wp-admin/css/press-this.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -350,6 +350,10 @@ div#widgets-right .closed .widgets-sortables {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.js .widgets-holder-wrap.closed .widget.ui-sortable-helper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Hide Widget Settings by Default */
|
||||
.widget-inside,
|
||||
.widget-description {
|
||||
@@ -506,6 +510,10 @@ div#widgets-right .widget-top:hover,
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#available-widgets .widget.ui-draggable-dragging .widget-top {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
/* =Media Queries
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
|
||||
@@ -350,6 +350,10 @@ div#widgets-right .closed .widgets-sortables {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.js .widgets-holder-wrap.closed .widget.ui-sortable-helper {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Hide Widget Settings by Default */
|
||||
.widget-inside,
|
||||
.widget-description {
|
||||
@@ -506,6 +510,10 @@ div#widgets-right .widget-top:hover,
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#available-widgets .widget.ui-draggable-dragging .widget-top {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
/* =Media Queries
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
|
||||
4
wp-admin/css/wp-admin-rtl.min.css
vendored
4
wp-admin/css/wp-admin-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
4
wp-admin/css/wp-admin.min.css
vendored
4
wp-admin/css/wp-admin.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -18,9 +18,11 @@ if ( ! current_user_can( 'customize' ) ) {
|
||||
|
||||
wp_reset_vars( array( 'url', 'return' ) );
|
||||
$url = wp_unslash( $url );
|
||||
$url = esc_url_raw( $url );
|
||||
$url = wp_validate_redirect( $url, home_url( '/' ) );
|
||||
if ( $return ) {
|
||||
$return = wp_unslash( $return );
|
||||
$return = esc_url_raw( $return );
|
||||
$return = wp_validate_redirect( $return );
|
||||
}
|
||||
if ( ! $return ) {
|
||||
@@ -146,7 +148,7 @@ do_action( 'customize_controls_print_scripts' );
|
||||
<div id="customize-info" class="accordion-section">
|
||||
<div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Customizer Options' ); ?>" tabindex="0">
|
||||
<span class="preview-notice"><?php
|
||||
echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );
|
||||
echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
|
||||
?></span>
|
||||
</div>
|
||||
<div class="accordion-section-content"><?php
|
||||
|
||||
@@ -952,6 +952,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 {
|
||||
@@ -1540,10 +1542,12 @@ function wp_ajax_inline_save() {
|
||||
$data['parent_id'] = $data['post_parent'];
|
||||
|
||||
// Status.
|
||||
if ( isset($data['keep_private']) && 'private' == $data['keep_private'] )
|
||||
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';
|
||||
@@ -1856,7 +1860,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => __( "You don't have permission to upload files." ),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -1870,7 +1874,7 @@ function wp_ajax_upload_attachment() {
|
||||
'success' => false,
|
||||
'data' => array(
|
||||
'message' => __( "You don't have permission to attach files to this post." ),
|
||||
'filename' => $_FILES['async-upload']['name'],
|
||||
'filename' => esc_html( $_FILES['async-upload']['name'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -1880,7 +1884,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' ) ) ) {
|
||||
@@ -1890,7 +1898,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'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -1905,7 +1913,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'] ),
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -2601,7 +2609,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.
|
||||
@@ -2883,6 +2891,8 @@ function wp_ajax_destroy_sessions() {
|
||||
* @see Plugin_Upgrader
|
||||
*/
|
||||
function wp_ajax_update_plugin() {
|
||||
global $wp_filesystem;
|
||||
|
||||
$plugin = urldecode( $_POST['plugin'] );
|
||||
|
||||
$status = array(
|
||||
@@ -2892,6 +2902,7 @@ function wp_ajax_update_plugin() {
|
||||
'oldVersion' => '',
|
||||
'newVersion' => '',
|
||||
);
|
||||
|
||||
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
|
||||
if ( $plugin_data['Version'] ) {
|
||||
$status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
|
||||
@@ -2906,15 +2917,17 @@ function wp_ajax_update_plugin() {
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
||||
|
||||
$current = get_site_transient( 'update_plugins' );
|
||||
if ( empty( $current ) ) {
|
||||
wp_update_plugins();
|
||||
}
|
||||
wp_update_plugins();
|
||||
|
||||
$upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() );
|
||||
$skin = new Automatic_Upgrader_Skin();
|
||||
$upgrader = new Plugin_Upgrader( $skin );
|
||||
$result = $upgrader->bulk_upgrade( array( $plugin ) );
|
||||
|
||||
if ( is_array( $result ) ) {
|
||||
if ( is_array( $result ) && empty( $result[$plugin] ) && is_wp_error( $skin->result ) ) {
|
||||
$result = $skin->result;
|
||||
}
|
||||
|
||||
if ( is_array( $result ) && !empty( $result[ $plugin ] ) ) {
|
||||
$plugin_update_data = current( $result );
|
||||
|
||||
/*
|
||||
@@ -2929,7 +2942,8 @@ function wp_ajax_update_plugin() {
|
||||
wp_send_json_error( $status );
|
||||
}
|
||||
|
||||
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
|
||||
$plugin_data = get_plugins( '/' . $result[ $plugin ]['destination_name'] );
|
||||
$plugin_data = reset( $plugin_data );
|
||||
|
||||
if ( $plugin_data['Version'] ) {
|
||||
$status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
|
||||
@@ -2939,10 +2953,18 @@ function wp_ajax_update_plugin() {
|
||||
} else if ( is_wp_error( $result ) ) {
|
||||
$status['error'] = $result->get_error_message();
|
||||
wp_send_json_error( $status );
|
||||
} else if ( is_bool( $result ) && ! $result ) {
|
||||
|
||||
} else if ( is_bool( $result ) && ! $result ) {
|
||||
$status['errorCode'] = 'unable_to_connect_to_filesystem';
|
||||
$status['error'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );
|
||||
|
||||
// Pass through the error from WP_Filesystem if one was raised
|
||||
if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) {
|
||||
$status['error'] = $wp_filesystem->errors->get_error_message();
|
||||
}
|
||||
|
||||
wp_send_json_error( $status );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ foreach ( $columns as $column_name => $column_display_name ) {
|
||||
<?php echo $att_title; ?></a>
|
||||
<?php };
|
||||
_media_states( $post ); ?></strong>
|
||||
<p class="filename"><?php echo wp_basename( $post->guid ); ?></p>
|
||||
<p class="filename"><?php echo esc_html( wp_basename( $post->guid ) ); ?></p>
|
||||
<?php
|
||||
echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
|
||||
?>
|
||||
|
||||
@@ -224,7 +224,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':
|
||||
|
||||
@@ -434,27 +434,27 @@ 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_' : '';
|
||||
|
||||
@@ -750,8 +750,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 ) {
|
||||
|
||||
@@ -119,10 +119,28 @@ class WP_Press_This {
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'draft',
|
||||
'post_format' => ( ! empty( $_POST['post_format'] ) ) ? sanitize_text_field( $_POST['post_format'] ) : '',
|
||||
'tax_input' => ( ! empty( $_POST['tax_input'] ) ) ? $_POST['tax_input'] : array(),
|
||||
'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(),
|
||||
);
|
||||
|
||||
// Only accept categories if the user actually can assign
|
||||
$category_tax = get_taxonomy( 'category' );
|
||||
if ( current_user_can( $category_tax->cap->assign_terms ) ) {
|
||||
$post_data['post_category'] = ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array();
|
||||
}
|
||||
|
||||
// Only accept taxonomies if the user can actually assign
|
||||
if ( ! empty( $_POST['tax_input'] ) ) {
|
||||
$tax_input = $_POST['tax_input'];
|
||||
foreach ( $tax_input as $tax => $_ti ) {
|
||||
$tax_object = get_taxonomy( $tax );
|
||||
if ( ! $tax_object || ! current_user_can( $tax_object->cap->assign_terms ) ) {
|
||||
unset( $tax_input[ $tax ] );
|
||||
}
|
||||
}
|
||||
|
||||
$post_data['tax_input'] = $tax_input;
|
||||
}
|
||||
|
||||
// Toggle status to pending if user cannot actually publish
|
||||
if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) {
|
||||
if ( current_user_can( 'publish_posts' ) ) {
|
||||
$post['post_status'] = 'publish';
|
||||
@@ -433,7 +451,7 @@ class WP_Press_This {
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param string $src Embed source URL.
|
||||
* @return string If not from a supported provider, an empty string. Otherwise, a reformattd embed URL.
|
||||
* @return string If not from a supported provider, an empty string. Otherwise, a reformatted embed URL.
|
||||
*/
|
||||
private function _limit_embed( $src ) {
|
||||
$src = $this->_limit_url( $src );
|
||||
@@ -679,7 +697,11 @@ class WP_Press_This {
|
||||
* making PT fully backward compatible with the older bookmarklet.
|
||||
*/
|
||||
if ( empty( $_POST ) && ! empty( $data['u'] ) ) {
|
||||
$data = $this->source_data_fetch_fallback( $data['u'], $data );
|
||||
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'scan-site' ) ) {
|
||||
$data = $this->source_data_fetch_fallback( $data['u'], $data );
|
||||
} else {
|
||||
$data['errors'] = 'missing nonce';
|
||||
}
|
||||
} else {
|
||||
foreach ( array( '_images', '_embeds' ) as $type ) {
|
||||
if ( empty( $_POST[ $type ] ) ) {
|
||||
@@ -823,6 +845,12 @@ class WP_Press_This {
|
||||
public function categories_html( $post ) {
|
||||
$taxonomy = get_taxonomy( 'category' );
|
||||
|
||||
// Bail if user cannot assign terms
|
||||
if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only show "add" if user can edit terms
|
||||
if ( current_user_can( $taxonomy->cap->edit_terms ) ) {
|
||||
?>
|
||||
<button type="button" class="add-cat-toggle button-subtle" aria-expanded="false">
|
||||
@@ -1173,7 +1201,7 @@ class WP_Press_This {
|
||||
$site_data = array(
|
||||
'v' => ! empty( $data['v'] ) ? $data['v'] : '',
|
||||
'u' => ! empty( $data['u'] ) ? $data['u'] : '',
|
||||
'hasData' => ! empty( $data ),
|
||||
'hasData' => ! empty( $data ) && ! isset( $data['errors'] ),
|
||||
);
|
||||
|
||||
if ( ! empty( $images ) ) {
|
||||
@@ -1234,6 +1262,12 @@ class WP_Press_This {
|
||||
wp_enqueue_script( 'json2' );
|
||||
wp_enqueue_script( 'editor' );
|
||||
|
||||
$categories_tax = get_taxonomy( 'category' );
|
||||
$show_categories = current_user_can( $categories_tax->cap->assign_terms ) || current_user_can( $categories_tax->cap->edit_terms );
|
||||
|
||||
$tag_tax = get_taxonomy( 'post_tag' );
|
||||
$show_tags = current_user_can( $tag_tax->cap->assign_terms );
|
||||
|
||||
$supports_formats = false;
|
||||
$post_format = 0;
|
||||
|
||||
@@ -1299,8 +1333,9 @@ class WP_Press_This {
|
||||
<div id="scanbar" class="scan">
|
||||
<form method="GET">
|
||||
<label for="url-scan" class="screen-reader-text"><?php _e( 'Scan site for content' ); ?></label>
|
||||
<input type="url" name="u" id="url-scan" class="scan-url" value="" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
|
||||
<input type="url" name="u" id="url-scan" class="scan-url" value="<?php echo esc_attr( $site_data['u'] ) ?>" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" />
|
||||
<input type="submit" name="url-scan-submit" id="url-scan-submit" class="scan-submit" value="<?php esc_attr_e( 'Scan' ) ?>" />
|
||||
<?php wp_nonce_field( 'scan-site' ); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1382,17 +1417,21 @@ class WP_Press_This {
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-category"></span>
|
||||
<span class="post-option-title"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php if ( $show_categories ) : ?>
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-category"></span>
|
||||
<span class="post-option-title"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-tag"></span>
|
||||
<span class="post-option-title"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php if ( $show_tags ) : ?>
|
||||
<button type="button" class="button-reset post-option">
|
||||
<span class="dashicons dashicons-tag"></span>
|
||||
<span class="post-option-title"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $supports_formats ) : ?>
|
||||
@@ -1406,23 +1445,27 @@ class WP_Press_This {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="setting-modal is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->categories_html( $post ); ?>
|
||||
</div>
|
||||
<?php if ( $show_categories ) : ?>
|
||||
<div class="setting-modal is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->categories_html( $post ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="setting-modal tags is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->tags_html( $post ); ?>
|
||||
</div>
|
||||
<?php if ( $show_tags ) : ?>
|
||||
<div class="setting-modal tags is-off-screen is-hidden">
|
||||
<button type="button" class="button-reset modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->tags_html( $post ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .options-panel -->
|
||||
</div><!-- .wrapper -->
|
||||
|
||||
|
||||
@@ -972,11 +972,14 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
// Check the folder contains at least 1 valid plugin.
|
||||
$plugins_found = false;
|
||||
foreach ( glob( $working_directory . '*.php' ) as $file ) {
|
||||
$info = get_plugin_data($file, false, false);
|
||||
if ( !empty( $info['Name'] ) ) {
|
||||
$plugins_found = true;
|
||||
break;
|
||||
$files = glob( $working_directory . '*.php' );
|
||||
if ( $files ) {
|
||||
foreach ( $files as $file ) {
|
||||
$info = get_plugin_data( $file, false, false );
|
||||
if ( ! empty( $info['Name'] ) ) {
|
||||
$plugins_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2327,8 +2330,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' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -420,7 +420,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>";
|
||||
|
||||
@@ -418,6 +418,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 ) {
|
||||
|
||||
@@ -146,7 +146,7 @@ function wp_tempnam( $filename = '', $dir = '' ) {
|
||||
$dir = get_temp_dir();
|
||||
}
|
||||
|
||||
if ( empty( $filename ) || '.' == $filename ) {
|
||||
if ( empty( $filename ) || '.' == $filename || '/' == $filename ) {
|
||||
$filename = time();
|
||||
}
|
||||
|
||||
@@ -602,6 +602,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
|
||||
@@ -757,6 +761,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'] );
|
||||
}
|
||||
@@ -1030,14 +1038,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
|
||||
@@ -1054,8 +1076,8 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||
$credentials['connection_type'] = 'ssh';
|
||||
} elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { //Only the FTP Extension understands SSL
|
||||
$credentials['connection_type'] = 'ftps';
|
||||
} elseif ( ! empty( $_POST['connection_type'] ) ) {
|
||||
$credentials['connection_type'] = wp_unslash( $_POST['connection_type'] );
|
||||
} elseif ( ! empty( $submitted_form['connection_type'] ) ) {
|
||||
$credentials['connection_type'] = $submitted_form['connection_type'];
|
||||
} elseif ( ! isset( $credentials['connection_type'] ) ) { //All else fails (And it's not defaulted to something else saved), Default to FTP
|
||||
$credentials['connection_type'] = 'ftp';
|
||||
}
|
||||
@@ -1188,11 +1210,12 @@ jQuery(function($){
|
||||
</fieldset>
|
||||
<?php
|
||||
foreach ( (array) $extra_fields as $field ) {
|
||||
if ( isset( $_POST[ $field ] ) )
|
||||
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( wp_unslash( $_POST[ $field ] ) ) . '" />';
|
||||
if ( isset( $submitted_form[ $field ] ) )
|
||||
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />';
|
||||
}
|
||||
?>
|
||||
<p class="request-filesystem-credentials-action-buttons">
|
||||
<?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>
|
||||
<button class="button cancel-button" data-js-action="close" type="button"><?php _e( 'Cancel' ); ?></button>
|
||||
<?php submit_button( __( 'Proceed' ), 'button', 'upgrade', false ); ?>
|
||||
</p>
|
||||
|
||||
@@ -278,7 +278,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||
$url = $file['url'];
|
||||
$type = $file['type'];
|
||||
$file = $file['file'];
|
||||
$title = $name;
|
||||
$title = sanitize_text_field( $name );
|
||||
$content = '';
|
||||
$excerpt = '';
|
||||
|
||||
@@ -2896,7 +2896,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
|
||||
if ( ! empty( $data[$version]['comments'] ) ) {
|
||||
foreach ( $data[$version]['comments'] as $key => $list ) {
|
||||
if ( 'length' !== $key && ! empty( $list ) ) {
|
||||
$metadata[$key] = reset( $list );
|
||||
$metadata[$key] = wp_kses_post( reset( $list ) );
|
||||
// Fix bug in byte stream analysis.
|
||||
if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
|
||||
$metadata[$key] = 'Cop' . $metadata[$key];
|
||||
|
||||
@@ -165,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.
|
||||
*
|
||||
@@ -234,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'] ) )
|
||||
@@ -311,7 +340,7 @@ function edit_post( $post_data = null ) {
|
||||
$attachment_data = isset( $post_data['attachments'][ $post_ID ] ) ? $post_data['attachments'][ $post_ID ] : array();
|
||||
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
$post_data = apply_filters( 'attachment_fields_to_save', $post_data, $attachment_data );
|
||||
$translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );
|
||||
}
|
||||
|
||||
// Convert taxonomy input to term IDs, to avoid ambiguity.
|
||||
@@ -356,7 +385,7 @@ function edit_post( $post_data = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_data['tax_input'][ $taxonomy ] = $clean_terms;
|
||||
$translated['tax_input'][ $taxonomy ] = $clean_terms;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,18 +393,18 @@ function edit_post( $post_data = null ) {
|
||||
|
||||
update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
|
||||
|
||||
$success = wp_update_post( $post_data );
|
||||
$success = wp_update_post( $translated );
|
||||
// If the save failed, see if we can sanity check the main fields and try again
|
||||
if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) {
|
||||
$fields = array( 'post_title', 'post_content', 'post_excerpt' );
|
||||
|
||||
foreach( $fields as $field ) {
|
||||
if ( isset( $post_data[ $field ] ) ) {
|
||||
$post_data[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $post_data[ $field ] );
|
||||
if ( isset( $translated[ $field ] ) ) {
|
||||
$translated[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $translated[ $field ] );
|
||||
}
|
||||
}
|
||||
|
||||
wp_update_post( $post_data );
|
||||
wp_update_post( $translated );
|
||||
}
|
||||
|
||||
// Now that we have an ID we can fix any attachment anchor hrefs
|
||||
@@ -533,9 +562,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 ] ) ) {
|
||||
@@ -543,14 +572,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 );
|
||||
|
||||
@@ -561,8 +588,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 );
|
||||
@@ -738,9 +765,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;
|
||||
|
||||
@@ -1292,15 +1320,15 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
|
||||
$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . esc_html( $post_name_abridged ) . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
|
||||
$pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post_name, urldecode( $permalink ) );
|
||||
|
||||
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
|
||||
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
|
||||
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
|
||||
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __( 'Edit' ) . "</a></span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
|
||||
}
|
||||
|
||||
if ( isset( $view_post ) ) {
|
||||
@@ -1314,7 +1342,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
$pretty_permalink = $permalink;
|
||||
}
|
||||
|
||||
$return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
|
||||
$return .= "<span id='view-post-btn'><a href='" . esc_url( $pretty_permalink ) . "' class='button button-small'>$view_post</a></span>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1542,7 +1570,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
|
||||
}
|
||||
|
||||
@@ -1601,6 +1629,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'];
|
||||
@@ -971,7 +973,8 @@ final class WP_Screen {
|
||||
|
||||
switch ( $this->base ) {
|
||||
case 'widgets':
|
||||
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||
$nonce = wp_create_nonce( 'widgets-access' );
|
||||
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=' . urlencode( $nonce ) . '">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=' . urlencode( $nonce ) . '">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||
break;
|
||||
case 'post' :
|
||||
$expand = '<div class="editor-expand hidden"><label for="editor-expand-toggle">';
|
||||
|
||||
@@ -830,7 +830,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>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -694,7 +694,10 @@ $_old_files = array(
|
||||
'wp-includes/js/jquery/ui/jquery.ui.tabs.min.js',
|
||||
'wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js',
|
||||
'wp-includes/js/jquery/ui/jquery.ui.widget.min.js',
|
||||
'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png'
|
||||
'wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png',
|
||||
// 4.9.2
|
||||
'wp-includes/js/mediaelement/flashmediaelement.swf',
|
||||
'wp-includes/js/mediaelement/silverlightmediaelement.xap',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -1047,9 +1050,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…' ) );
|
||||
@@ -1188,3 +1198,70 @@ 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 ) {
|
||||
$affected_theme_files = _upgrade_422_find_genericons_files_in_folder( $directory );
|
||||
$affected_files = array_merge( $affected_files, $affected_theme_files );
|
||||
}
|
||||
|
||||
// Plugins
|
||||
$affected_plugin_files = _upgrade_422_find_genericons_files_in_folder( WP_PLUGIN_DIR );
|
||||
$affected_files = array_merge( $affected_files, $affected_plugin_files );
|
||||
|
||||
foreach ( $affected_files as $file ) {
|
||||
$gen_dir = $wp_filesystem->find_folder( trailingslashit( dirname( $file ) ) );
|
||||
if ( empty( $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 ) {
|
||||
$directory = trailingslashit( $directory );
|
||||
$files = array();
|
||||
|
||||
if ( file_exists( "{$directory}example.html" ) && false !== strpos( file_get_contents( "{$directory}example.html" ), '<title>Genericons</title>' ) ) {
|
||||
$files[] = "{$directory}example.html";
|
||||
}
|
||||
|
||||
$dirs = glob( $directory . '*', GLOB_ONLYDIR );
|
||||
if ( $dirs ) {
|
||||
foreach ( $dirs as $dir ) {
|
||||
$files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
@@ -524,8 +524,11 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 29630 )
|
||||
upgrade_400();
|
||||
|
||||
if ( $wp_current_db_version < 31351 )
|
||||
upgrade_420();
|
||||
if ( $wp_current_db_version < 31534 )
|
||||
upgrade_422();
|
||||
|
||||
if ( $wp_current_db_version < 31536 )
|
||||
upgrade_423();
|
||||
|
||||
maybe_disable_link_manager();
|
||||
|
||||
@@ -1420,13 +1423,81 @@ function upgrade_400() {
|
||||
* @since 4.2.0
|
||||
*/
|
||||
function upgrade_420() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 4.2.1.
|
||||
*
|
||||
* @since 4.2.1
|
||||
*/
|
||||
function upgrade_421() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 4.2.2.
|
||||
*
|
||||
* @since 4.2.2
|
||||
*/
|
||||
function upgrade_422() {
|
||||
global $wp_current_db_version, $wpdb;
|
||||
|
||||
if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
|
||||
if ( $wp_current_db_version < 31534 ) {
|
||||
$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 changes made in WordPress 4.2.0.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*/
|
||||
function upgrade_423() {
|
||||
global $wp_current_db_version, $wpdb;
|
||||
|
||||
if ( $wp_current_db_version < 31536 && $wpdb->charset === 'utf8mb4' ) {
|
||||
if ( is_multisite() ) {
|
||||
$tables = $wpdb->tables( 'blog' );
|
||||
} else {
|
||||
$tables = $wpdb->tables( 'all' );
|
||||
if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
|
||||
$global_tables = $wpdb->tables( 'global' );
|
||||
$tables = array_diff_assoc( $tables, $global_tables );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $tables as $table ) {
|
||||
@@ -1534,11 +1605,11 @@ function upgrade_network() {
|
||||
|
||||
// 4.2
|
||||
if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
|
||||
if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_UPGRADE_GLOBAL_TABLES ) ) {
|
||||
if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
|
||||
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
|
||||
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
|
||||
|
||||
$tables = $wpdb->tables( 'global' );
|
||||
|
||||
@@ -1547,6 +1618,35 @@ function upgrade_network() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 4.2.2
|
||||
if ( $wp_current_db_version < 31535 && 'utf8mb4' === $wpdb->charset ) {
|
||||
if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
|
||||
$upgrade = false;
|
||||
$indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
|
||||
foreach( $indexes as $index ) {
|
||||
if ( 'domain_path' == $index->Key_name && 'domain' == $index->Column_name && 140 != $index->Sub_part ) {
|
||||
$upgrade = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $upgrade ) {
|
||||
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 4.2.3
|
||||
if ( $wp_current_db_version < 31536 && $wpdb->charset === 'utf8mb4' ) {
|
||||
if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
|
||||
$tables = $wpdb->tables( 'global' );
|
||||
|
||||
foreach ( $tables as $table ) {
|
||||
maybe_convert_table_to_utf8mb4( $table );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1679,6 +1779,17 @@ function maybe_convert_table_to_utf8mb4( $table ) {
|
||||
}
|
||||
}
|
||||
|
||||
$table_details = $wpdb->get_row( "SHOW TABLE STATUS LIKE '$table'" );
|
||||
if ( ! $table_details ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list( $table_charset ) = explode( '_', $table_details->Collation );
|
||||
$table_charset = strtolower( $table_charset );
|
||||
if ( 'utf8mb4' === $table_charset ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $wpdb->query( "ALTER TABLE $table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci" );
|
||||
}
|
||||
|
||||
@@ -1838,6 +1949,9 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
*/
|
||||
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
|
||||
|
||||
$text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );
|
||||
$blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );
|
||||
|
||||
$global_tables = $wpdb->tables( 'global' );
|
||||
foreach ( $cqueries as $table => $qry ) {
|
||||
// Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
|
||||
@@ -1907,9 +2021,24 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
|
||||
// Is actual field type different from the field type in query?
|
||||
if ($tablefield->Type != $fieldtype) {
|
||||
$do_change = true;
|
||||
if ( in_array( strtolower( $fieldtype ), $text_fields ) && in_array( strtolower( $tablefield->Type ), $text_fields ) ) {
|
||||
if ( array_search( strtolower( $fieldtype ), $text_fields ) < array_search( strtolower( $tablefield->Type ), $text_fields ) ) {
|
||||
$do_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( in_array( strtolower( $fieldtype ), $blob_fields ) && in_array( strtolower( $tablefield->Type ), $blob_fields ) ) {
|
||||
if ( array_search( strtolower( $fieldtype ), $blob_fields ) < array_search( strtolower( $tablefield->Type ), $blob_fields ) ) {
|
||||
$do_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $do_change ) {
|
||||
// Add a query to change the column type
|
||||
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
|
||||
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
|
||||
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
|
||||
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
|
||||
}
|
||||
}
|
||||
|
||||
// Get the default value from the array
|
||||
@@ -2366,14 +2495,9 @@ function pre_schema_upgrade() {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $wp_current_db_version < 30133 ) {
|
||||
// dbDelta() can recreate but can't drop the index.
|
||||
$wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug" );
|
||||
}
|
||||
|
||||
// Upgrade versions prior to 4.2.
|
||||
if ( $wp_current_db_version < 31351 ) {
|
||||
if ( ! is_multisite() ) {
|
||||
if ( ! is_multisite() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
|
||||
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
|
||||
}
|
||||
$wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug, ADD INDEX slug(slug(191))" );
|
||||
|
||||
@@ -860,7 +860,7 @@ $(document).ready( function() {
|
||||
window.wpResponsive.init();
|
||||
setPinMenu();
|
||||
|
||||
$document.on( 'wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu', setPinMenu );
|
||||
$document.on( 'wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu', setPinMenu );
|
||||
});
|
||||
|
||||
// Fire a custom jQuery event at the end of window resize
|
||||
|
||||
2
wp-admin/js/common.min.js
vendored
2
wp-admin/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -2703,6 +2703,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Ensure preview nonce is included with every customized request, to allow post data to be read.
|
||||
$.ajaxPrefilter( function injectPreviewNonce( options ) {
|
||||
if ( ! /wp_customize=on/.test( options.data ) ) {
|
||||
return;
|
||||
}
|
||||
options.data += '&' + $.param({
|
||||
customize_preview_nonce: api.settings.nonce.preview
|
||||
});
|
||||
});
|
||||
|
||||
// Refresh the nonces if the preview sends updated nonces over.
|
||||
api.previewer.bind( 'nonce', function( nonce ) {
|
||||
$.extend( this.nonce, nonce );
|
||||
|
||||
4
wp-admin/js/customize-controls.min.js
vendored
4
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -124,7 +124,7 @@ jQuery(document).ready( function($) {
|
||||
};
|
||||
quickPressLoad();
|
||||
|
||||
$( '.meta-box-sortables' ).sortable( 'option', 'containment', 'document' );
|
||||
$( '.meta-box-sortables' ).sortable( 'option', 'containment', '#wpwrap' );
|
||||
|
||||
function autoResizeTextarea() {
|
||||
if ( document.documentMode && document.documentMode < 9 ) {
|
||||
|
||||
2
wp-admin/js/dashboard.min.js
vendored
2
wp-admin/js/dashboard.min.js
vendored
@@ -1 +1 @@
|
||||
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){function b(){if(!(document.documentMode&&document.documentMode<9)){a("body").append('<div class="quick-draft-textarea-clone" style="display: none;"></div>');var b=a(".quick-draft-textarea-clone"),c=a("#content"),d=c.height(),e=a(window).height()-100;b.css({"font-family":c.css("font-family"),"font-size":c.css("font-size"),"line-height":c.css("line-height"),"padding-bottom":c.css("paddingBottom"),"padding-left":c.css("paddingLeft"),"padding-right":c.css("paddingRight"),"padding-top":c.css("paddingTop"),"white-space":"pre-wrap","word-wrap":"break-word",display:"none"}),c.on("focus input propertychange",function(){var f=a(this),g=f.val()+" ",h=b.css("width",f.css("width")).text(g).outerHeight()+2;c.css("overflow-y","auto"),h===d||h>=e&&d>=e||(d=h>e?e:h,c.css("overflow","hidden"),f.css("height",d+"px"))})}}var c,d=a("#welcome-panel"),e=a("#wp_welcome_panel-hide");c=function(b){a.post(ajaxurl,{action:"update-welcome-panel",visible:b,welcomepanelnonce:a("#welcomepanelnonce").val()})},d.hasClass("hidden")&&e.prop("checked")&&d.removeClass("hidden"),a(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function(b){b.preventDefault(),d.addClass("hidden"),c(0),a("#wp_welcome_panel-hide").prop("checked",!1)}),e.click(function(){d.toggleClass("hidden",!this.checked),c(this.checked?1:0)}),ajaxWidgets=["dashboard_primary"],ajaxPopulateWidgets=function(b){function c(b,c){var d,e=a("#"+c+" div.inside:visible").find(".widget-loading");e.length&&(d=e.parent(),setTimeout(function(){d.load(ajaxurl+"?action=dashboard-widgets&widget="+c+"&pagenow="+pagenow,"",function(){d.hide().slideDown("normal",function(){a(this).css("display","")})})},500*b))}b?(b=b.toString(),-1!==a.inArray(b,ajaxWidgets)&&c(0,b)):a.each(ajaxWidgets,c)},ajaxPopulateWidgets(),postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets}),quickPressLoad=function(){var c,d=a("#quickpost-action");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!1),c=a("#quick-press").submit(function(){function b(){var b=a(".drafts ul li").first();b.css("background","#fffbe5"),setTimeout(function(){b.css("background","none")},1e3)}return a("#dashboard_quick_press #publishing-action .spinner").show(),a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!0),a.post(c.attr("action"),c.serializeArray(),function(c){a("#dashboard_quick_press .inside").html(c),a("#quick-press").removeClass("initial-form"),quickPressLoad(),b(),a("#title").focus()}),!1}),a("#publish").click(function(){d.val("post-quickpress-publish")}),a("#title, #tags-input, #content").each(function(){var b=a(this),c=a("#"+this.id+"-prompt-text");""===this.value&&c.removeClass("screen-reader-text"),c.click(function(){a(this).addClass("screen-reader-text"),b.focus()}),b.blur(function(){""===this.value&&c.removeClass("screen-reader-text")}),b.focus(function(){c.addClass("screen-reader-text")})}),a("#quick-press").on("click focusin",function(){wpActiveEditor="content"}),b()},quickPressLoad(),a(".meta-box-sortables").sortable("option","containment","document")});
|
||||
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){function b(){if(!(document.documentMode&&document.documentMode<9)){a("body").append('<div class="quick-draft-textarea-clone" style="display: none;"></div>');var b=a(".quick-draft-textarea-clone"),c=a("#content"),d=c.height(),e=a(window).height()-100;b.css({"font-family":c.css("font-family"),"font-size":c.css("font-size"),"line-height":c.css("line-height"),"padding-bottom":c.css("paddingBottom"),"padding-left":c.css("paddingLeft"),"padding-right":c.css("paddingRight"),"padding-top":c.css("paddingTop"),"white-space":"pre-wrap","word-wrap":"break-word",display:"none"}),c.on("focus input propertychange",function(){var f=a(this),g=f.val()+" ",h=b.css("width",f.css("width")).text(g).outerHeight()+2;c.css("overflow-y","auto"),h===d||h>=e&&d>=e||(d=h>e?e:h,c.css("overflow","hidden"),f.css("height",d+"px"))})}}var c,d=a("#welcome-panel"),e=a("#wp_welcome_panel-hide");c=function(b){a.post(ajaxurl,{action:"update-welcome-panel",visible:b,welcomepanelnonce:a("#welcomepanelnonce").val()})},d.hasClass("hidden")&&e.prop("checked")&&d.removeClass("hidden"),a(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function(b){b.preventDefault(),d.addClass("hidden"),c(0),a("#wp_welcome_panel-hide").prop("checked",!1)}),e.click(function(){d.toggleClass("hidden",!this.checked),c(this.checked?1:0)}),ajaxWidgets=["dashboard_primary"],ajaxPopulateWidgets=function(b){function c(b,c){var d,e=a("#"+c+" div.inside:visible").find(".widget-loading");e.length&&(d=e.parent(),setTimeout(function(){d.load(ajaxurl+"?action=dashboard-widgets&widget="+c+"&pagenow="+pagenow,"",function(){d.hide().slideDown("normal",function(){a(this).css("display","")})})},500*b))}b?(b=b.toString(),-1!==a.inArray(b,ajaxWidgets)&&c(0,b)):a.each(ajaxWidgets,c)},ajaxPopulateWidgets(),postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets}),quickPressLoad=function(){var c,d=a("#quickpost-action");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!1),c=a("#quick-press").submit(function(){function b(){var b=a(".drafts ul li").first();b.css("background","#fffbe5"),setTimeout(function(){b.css("background","none")},1e3)}return a("#dashboard_quick_press #publishing-action .spinner").show(),a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!0),a.post(c.attr("action"),c.serializeArray(),function(c){a("#dashboard_quick_press .inside").html(c),a("#quick-press").removeClass("initial-form"),quickPressLoad(),b(),a("#title").focus()}),!1}),a("#publish").click(function(){d.val("post-quickpress-publish")}),a("#title, #tags-input, #content").each(function(){var b=a(this),c=a("#"+this.id+"-prompt-text");""===this.value&&c.removeClass("screen-reader-text"),c.click(function(){a(this).addClass("screen-reader-text"),b.focus()}),b.blur(function(){""===this.value&&c.removeClass("screen-reader-text")}),b.focus(function(){c.addClass("screen-reader-text")})}),a("#quick-press").on("click focusin",function(){wpActiveEditor="content"}),b()},quickPressLoad(),a(".meta-box-sortables").sortable("option","containment","#wpwrap")});
|
||||
@@ -15,7 +15,7 @@
|
||||
$visualEditor = $(),
|
||||
$textTop = $( '#ed_toolbar' ),
|
||||
$textEditor = $( '#content' ),
|
||||
$textEditorClone = $( '<div id="content-textarea-clone"></div>' ),
|
||||
$textEditorClone = $( '<div id="content-textarea-clone" class="wp-exclude-emoji"></div>' ),
|
||||
$bottom = $( '#post-status-info' ),
|
||||
$menuBar = $(),
|
||||
$statusBar = $(),
|
||||
|
||||
2
wp-admin/js/editor-expand.min.js
vendored
2
wp-admin/js/editor-expand.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -492,7 +492,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 );
|
||||
|
||||
// Mark this item's accessibility as refreshed
|
||||
$this.data( 'needs_accessibility_refresh', false );
|
||||
|
||||
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
@@ -46,9 +46,10 @@ window.wp = window.wp || {};
|
||||
connectionType: null
|
||||
},
|
||||
ssh: {
|
||||
publicKey: null,
|
||||
privateKey: null
|
||||
}
|
||||
publicKey: '',
|
||||
privateKey: ''
|
||||
},
|
||||
fsNonce: ''
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -180,6 +181,7 @@ window.wp = window.wp || {};
|
||||
_ajax_nonce: wp.updates.ajaxNonce,
|
||||
plugin: plugin,
|
||||
slug: slug,
|
||||
_fs_nonce: wp.updates.filesystemCredentials.fsNonce,
|
||||
username: wp.updates.filesystemCredentials.ftp.username,
|
||||
password: wp.updates.filesystemCredentials.ftp.password,
|
||||
hostname: wp.updates.filesystemCredentials.ftp.hostname,
|
||||
@@ -250,7 +252,7 @@ window.wp = window.wp || {};
|
||||
wp.updates.updateError = function( response ) {
|
||||
var $message, name;
|
||||
wp.updates.updateDoneSuccessfully = false;
|
||||
if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' ) {
|
||||
if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' && wp.updates.shouldRequestFilesystemCredentials ) {
|
||||
wp.updates.credentialError( response, 'update-plugin' );
|
||||
return;
|
||||
}
|
||||
@@ -263,10 +265,18 @@ window.wp = window.wp || {};
|
||||
$message.attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', name ) );
|
||||
}
|
||||
$message.removeClass( 'updating-message' );
|
||||
$message.text( wp.updates.l10n.updateFailed );
|
||||
$message.html( wp.updates.l10n.updateFailed + ': ' + response.error );
|
||||
wp.a11y.speak( wp.updates.l10n.updateFailed );
|
||||
|
||||
/*
|
||||
* The lock can be released since this failure was
|
||||
* after the credentials form.
|
||||
*/
|
||||
wp.updates.updateLock = false;
|
||||
|
||||
$(document).trigger( 'wp-plugin-update-error', response );
|
||||
|
||||
wp.updates.queueChecker();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -446,6 +456,7 @@ window.wp = window.wp || {};
|
||||
// File system credentials form submit noop-er / handler.
|
||||
$( '#request-filesystem-credentials-dialog form' ).on( 'submit', function() {
|
||||
// Persist the credentials input by the user for the duration of the page load.
|
||||
wp.updates.filesystemCredentials.fsNonce = $( '#_fs_nonce' ).val();
|
||||
wp.updates.filesystemCredentials.ftp.hostname = $('#hostname').val();
|
||||
wp.updates.filesystemCredentials.ftp.username = $('#username').val();
|
||||
wp.updates.filesystemCredentials.ftp.password = $('#password').val();
|
||||
@@ -467,6 +478,11 @@ window.wp = window.wp || {};
|
||||
wp.updates.requestForCredentialsModalCancel();
|
||||
});
|
||||
|
||||
// Hide SSH fields when not selected
|
||||
$( '#request-filesystem-credentials-dialog input[name="connection_type"]' ).on( 'change', function() {
|
||||
$( this ).parents( 'form' ).find( '#private_key, #public_key' ).parents( 'label' ).toggle( ( 'ssh' == $( this ).val() ) );
|
||||
}).change();
|
||||
|
||||
// Click handler for plugin updates in List Table view.
|
||||
$( '.plugin-update-tr' ).on( 'click', '.update-link', function( e ) {
|
||||
e.preventDefault();
|
||||
@@ -490,7 +506,6 @@ window.wp = window.wp || {};
|
||||
wp.updates.updatePlugin( $button.data( 'plugin' ), $button.data( 'slug' ) );
|
||||
} );
|
||||
|
||||
//
|
||||
$( '#plugin_update_from_iframe' ).on( 'click' , function( e ) {
|
||||
var target, data;
|
||||
|
||||
|
||||
2
wp-admin/js/updates.min.js
vendored
2
wp-admin/js/updates.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
/*global ajaxurl, isRtl */
|
||||
var wpWidgets;
|
||||
(function($) {
|
||||
var $document = $( document );
|
||||
|
||||
wpWidgets = {
|
||||
|
||||
@@ -22,10 +23,13 @@ wpWidgets = {
|
||||
} else {
|
||||
$wrap.addClass('closed');
|
||||
}
|
||||
|
||||
$document.triggerHandler( 'wp-pin-menu' );
|
||||
});
|
||||
|
||||
$('#widgets-left .sidebar-name').click( function() {
|
||||
$(this).closest('.widgets-holder-wrap').toggleClass('closed');
|
||||
$document.triggerHandler( 'wp-pin-menu' );
|
||||
});
|
||||
|
||||
$(document.body).bind('click.widgets-toggle', function(e) {
|
||||
@@ -89,7 +93,7 @@ wpWidgets = {
|
||||
distance: 2,
|
||||
helper: 'clone',
|
||||
zIndex: 100,
|
||||
containment: 'document',
|
||||
containment: '#wpwrap',
|
||||
start: function( event, ui ) {
|
||||
var chooser = $(this).find('.widgets-chooser');
|
||||
|
||||
@@ -119,7 +123,7 @@ wpWidgets = {
|
||||
handle: '> .widget-top > .widget-title',
|
||||
cursor: 'move',
|
||||
distance: 2,
|
||||
containment: 'document',
|
||||
containment: '#wpwrap',
|
||||
start: function( event, ui ) {
|
||||
var height, $this = $(this),
|
||||
$wrap = $this.parent(),
|
||||
@@ -174,7 +178,7 @@ wpWidgets = {
|
||||
|
||||
wpWidgets.save( $widget, 0, 0, 1 );
|
||||
$widget.find('input.add_new').val('');
|
||||
$( document ).trigger( 'widget-added', [ $widget ] );
|
||||
$document.trigger( 'widget-added', [ $widget ] );
|
||||
}
|
||||
|
||||
$sidebar = $widget.parent();
|
||||
@@ -381,7 +385,7 @@ wpWidgets = {
|
||||
if ( r && r.length > 2 ) {
|
||||
$( 'div.widget-content', widget ).html( r );
|
||||
wpWidgets.appendTitle( widget );
|
||||
$( document ).trigger( 'widget-updated', [ widget ] );
|
||||
$document.trigger( 'widget-updated', [ widget ] );
|
||||
}
|
||||
}
|
||||
if ( order ) {
|
||||
@@ -446,7 +450,7 @@ wpWidgets = {
|
||||
// No longer "new" widget
|
||||
widget.find( 'input.add_new' ).val('');
|
||||
|
||||
$( document ).trigger( 'widget-added', [ widget ] );
|
||||
$document.trigger( 'widget-added', [ widget ] );
|
||||
|
||||
/*
|
||||
* Check if any part of the sidebar is visible in the viewport. If it is, don't scroll.
|
||||
@@ -489,6 +493,6 @@ wpWidgets = {
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready( function(){ wpWidgets.init(); } );
|
||||
$document.ready( function(){ wpWidgets.init(); } );
|
||||
|
||||
})(jQuery);
|
||||
|
||||
2
wp-admin/js/widgets.min.js
vendored
2
wp-admin/js/widgets.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -273,7 +273,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
|
||||
<td>
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo get_site_option('first_comment_author') ?>" />
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" aria-describedby="first-comment-author-desc" value="<?php echo esc_attr( get_site_option('first_comment_author') ); ?>" />
|
||||
<p class="description" id="first-comment-author-desc">
|
||||
<?php _e( 'The author of the first comment on a new site.' ) ?>
|
||||
</p>
|
||||
|
||||
@@ -93,9 +93,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;
|
||||
}
|
||||
|
||||
@@ -181,14 +181,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>
|
||||
@@ -232,7 +232,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.
|
||||
@@ -39,10 +39,10 @@ if ( $action ) {
|
||||
|
||||
check_admin_referer('activate-plugin_' . $plugin);
|
||||
|
||||
$result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() );
|
||||
$result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );
|
||||
if ( is_wp_error( $result ) ) {
|
||||
if ( 'unexpected_output' == $result->get_error_code() ) {
|
||||
$redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
|
||||
$redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s");
|
||||
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
|
||||
exit;
|
||||
} else {
|
||||
@@ -69,7 +69,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 ) {
|
||||
@@ -109,9 +109,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();
|
||||
|
||||
@@ -183,7 +183,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' );
|
||||
@@ -216,7 +216,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;
|
||||
@@ -228,6 +228,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'] )
|
||||
@@ -115,8 +121,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 );
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -125,10 +125,12 @@ default:
|
||||
<div id="message" class="updated notice is-dismissible"><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>
|
||||
@@ -177,9 +179,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>';
|
||||
|
||||
@@ -234,6 +234,8 @@ function list_plugin_updates() {
|
||||
<tbody class="plugins">
|
||||
<?php
|
||||
foreach ( (array) $plugins as $plugin_file => $plugin_data) {
|
||||
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
|
||||
|
||||
$info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
|
||||
if ( is_wp_error( $info ) ) {
|
||||
$info = false;
|
||||
|
||||
@@ -99,7 +99,7 @@ if ( is_multisite()
|
||||
// Execute confirmed email change. See send_confirmation_on_profile_email().
|
||||
if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
|
||||
$new_email = get_option( $current_user->ID . '_new_email' );
|
||||
if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
|
||||
if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) {
|
||||
$user = new stdClass;
|
||||
$user->ID = $current_user->ID;
|
||||
$user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) );
|
||||
@@ -110,7 +110,8 @@ if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $c
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
}
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) {
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
|
||||
check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
|
||||
delete_option( $current_user->ID . '_new_email' );
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
@@ -193,7 +194,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; ?>
|
||||
@@ -402,7 +403,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>
|
||||
|
||||
@@ -69,7 +69,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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,719 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Genericons</title>
|
||||
<link rel="stylesheet" href="genericons.css">
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||
<style type="text/css">
|
||||
/**
|
||||
* Example page CSS
|
||||
*/
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
color: #2f2d2c;
|
||||
background: #fff;
|
||||
font-size: 11pt;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #2f2d2c;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
#iconlist {
|
||||
clear: both;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#iconlist div {
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
font-size: 32px;
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#iconlist div:before {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#iconlist div:hover {
|
||||
cursor: pointer;
|
||||
color: #e4c05c;
|
||||
}
|
||||
|
||||
#primary {
|
||||
background: #e4c05c;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#content {
|
||||
position: relative;
|
||||
color: #fff;
|
||||
max-width: 980px;
|
||||
padding: 0 10px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#icons {
|
||||
background: #fbfbfb;
|
||||
}
|
||||
|
||||
#icons #iconlist {
|
||||
max-width: 980px;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
-webkit-box-sizing:border-box;
|
||||
padding: 20px 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#glyph {
|
||||
float: left;
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
-webkit-box-sizing:border-box;
|
||||
-ms-box-sizing:border-box;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
#glyph .info {
|
||||
float: right;
|
||||
width: 180px;
|
||||
padding: 36px 0 0 0;
|
||||
}
|
||||
|
||||
#glyph .info a {
|
||||
color: #2f2d2c;
|
||||
display: block;
|
||||
padding: 8px 0 8px 15px;
|
||||
}
|
||||
|
||||
#glyph .info strong {
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
#glyph .genericon {
|
||||
font-size: 256px;
|
||||
width: 256px;
|
||||
height: 256px;
|
||||
overflow: visible;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-top: 50px;
|
||||
width: 48%;
|
||||
float: right;
|
||||
padding-left: 40px;
|
||||
margin-left: 2%;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
-webkit-box-sizing:border-box;
|
||||
-ms-box-sizing:border-box;
|
||||
background-size: 4px 4px;
|
||||
}
|
||||
|
||||
#primary h2 {
|
||||
color: white;
|
||||
margin: 0 auto;
|
||||
padding: 22px 0 0 20px;
|
||||
max-width: 980px;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#primary h2 span {
|
||||
display: block;
|
||||
font-weight: normal;
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
max-width: 980px;
|
||||
margin: 80px auto;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .1em;
|
||||
font-size: 7pt;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
#footer a {
|
||||
color: #ccc;
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
overflow: hidden;
|
||||
text-indent: 100%;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
opacity: .3;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center top;
|
||||
background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjQsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTUwcHgiIGhlaWdodD0iMTRweCIgdmlld0JveD0iMTAgMCAxNTAgMTQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMTAgMCAxNTAgMTQiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZmlsbD0iIzQ0NDQ0NCIgZD0iTTY1LjQzOCwxMi41Yy0zLjYyNiwwLTUuOTc2LTIuNjEyLTUuOTc2LTUuMzMxVjYuODMxYzAtMi43NjUsMi4zNTEtNS4zMyw1Ljk3Ni01LjMzDQoJCWMzLjY0MSwwLDUuOTksMi41NjUsNS45OSw1LjMzdjAuMzM5QzcxLjQyOCw5Ljg4OCw2OS4wNzksMTIuNSw2NS40MzgsMTIuNXogTTY5LjQ5Miw2Ljg2MWMwLTEuOTgtMS40NDQtMy43NDgtNC4wNTUtMy43NDgNCgkJcy00LjA0LDEuNzY4LTQuMDQsMy43NDh2MC4yNDZjMCwxLjk4MSwxLjQyOSwzLjc3OSw0LjA0LDMuNzc5czQuMDU1LTEuNzk4LDQuMDU1LTMuNzc5VjYuODYxeiIvPg0KCTxwYXRoIGZpbGw9IiM0NDQ0NDQiIGQ9Ik0yNC40OTgsMTIuMWwtMS4zNTItMi41MzVoLTYuMDA3TDE1LjgzNCwxMi4xaC0yLjAyOGw1LjUzMS0xMC4yM2gxLjU5N2w1LjYyMiwxMC4yM0gyNC40OThMMjQuNDk4LDEyLjF6DQoJCSBNMjAuMDksMy44NjZsLTIuMjI4LDQuMzAxaDQuNTMxTDIwLjA5LDMuODY2eiIvPg0KCTxwYXRoIGZpbGw9IiM0NDQ0NDQiIGQ9Ik0zNS4yODEsMTIuNWMtMy42NzEsMC01LjM3Ni0xLjk5Ni01LjM3Ni00LjY1NFYxLjg3aDEuOTA0djYuMDA2YzAsMS44OTEsMS4yNDUsMy4wMTMsMy42MSwzLjAxMw0KCQljMi40MjgsMCwzLjQyNi0xLjEyMiwzLjQyNi0zLjAxM1YxLjg3aDEuOTJ2NS45NzZDNDAuNzY3LDEwLjM4LDM5LjEzOCwxMi41LDM1LjI4MSwxMi41eiIvPg0KCTxwYXRoIGZpbGw9IiM0NDQ0NDQiIGQ9Ik01MS40NTgsMy40NjdWMTIuMWgtMS45MTlWMy40NjdoLTQuNDcxVjEuODdoMTAuODZ2MS41OThMNTEuNDU4LDMuNDY3TDUxLjQ1OCwzLjQ2N3oiLz4NCgk8cGF0aCBmaWxsPSIjNDQ0NDQ0IiBkPSJNODguNTQzLDEyLjFWNC4wMDRsLTAuNTA5LDAuODkxTDgzLjc0OSwxMi4xaC0wLjkzN2wtNC4yNC03LjIwNWwtMC41MDYtMC44OTFWMTIuMWgtMS44NzVWMS44N2gyLjY1OA0KCQlsNC4wNCw3LjAyMWwwLjQ3NiwwLjg2bDAuNDc3LTAuODZsMy45OTQtNy4wMjFoMi42MjdWMTIuMUg4OC41NDNMODguNTQzLDEyLjF6Ii8+DQoJPHBhdGggZmlsbD0iIzQ0NDQ0NCIgZD0iTTEwNC45NzgsMTIuMWwtMS4zNTItMi41MzVoLTYuMDA4TDk2LjMxMywxMi4xaC0yLjAyOGw1LjUzMS0xMC4yMzFoMS41OTlsNS42MjIsMTAuMjMxSDEwNC45Nzh6DQoJCSBNMTAwLjU3LDMuODY2bC0yLjIyOCw0LjMwMWg0LjUyOUwxMDAuNTcsMy44NjZ6Ii8+DQoJPHBhdGggZmlsbD0iIzQ0NDQ0NCIgZD0iTTExNC43NzgsMy40NjdWMTIuMWgtMS45MlYzLjQ2N2gtNC40N1YxLjg3aDEwLjg2djEuNTk4TDExNC43NzgsMy40NjdMMTE0Ljc3OCwzLjQ2N3oiLz4NCgk8cGF0aCBmaWxsPSIjNDQ0NDQ0IiBkPSJNMTI4Ljg2NiwzLjQ2N1YxMi4xaC0xLjkxOVYzLjQ2N2gtNC40NzJWMS44N2gxMC44NnYxLjU5OEwxMjguODY2LDMuNDY3TDEyOC44NjYsMy40Njd6Ii8+DQoJPHBhdGggZmlsbD0iIzQ0NDQ0NCIgZD0iTTEzOC4wNjcsMTIuMVYyLjgzN2MwLjc2OSwwLDEuMDc2LTAuNDE1LDEuMDc2LTAuOTY4aDAuODE0VjEyLjFIMTM4LjA2N0wxMzguMDY3LDEyLjF6Ii8+DQoJPHBhdGggZmlsbD0iIzQ0NDQ0NCIgZD0iTTE1NC45OTYsNC43NTdjLTAuOTIxLTAuODQ1LTIuMjc0LTEuNjQ0LTQuMTAyLTEuNjQ0Yy0yLjczMywwLTQuMjcsMS44NzUtNC4yNywzLjgyNXYwLjINCgkJYzAsMS45MzcsMS41NTEsMy43NDgsNC40MDgsMy43NDhjMS43MDUsMCwzLjExOC0wLjgxNCw0LjAwOS0xLjY0NGwxLjE1MiwxLjIxNWMtMS4xMjEsMS4xMDctMy4wMjYsMi4wNDMtNS4yODUsMi4wNDMNCgkJYy0zLjg3LDAtNi4yMjMtMi41MjEtNi4yMjMtNS4yODRWNi44NzdjMC0yLjc2NiwyLjU2Ni01LjM3Nyw2LjMxNC01LjM3N2MyLjE2NywwLDQuMTM2LDAuOTA2LDUuMTk0LDIuMDQzTDE1NC45OTYsNC43NTd6Ii8+DQoJPHBhdGggZmlsbD0iIzQ0NDQ0NCIgZD0iTTY2LjcwMiw1LjA2YzAuMzQ3LDAuMjI0LDAuNDQ0LDAuNjg3LDAuMjE5LDEuMDM3TDY1LjE2OSw4LjgxYy0wLjIyNSwwLjM0Ny0wLjY4OCwwLjQ0OC0xLjAzMywwLjIyOWwwLDANCgkJQzYzLjc5LDguODEyLDYzLjY5Miw4LjM1MSw2My45MTcsOGwxLjc1MS0yLjcxM0M2NS44OTMsNC45MzgsNjYuMzU1LDQuODM3LDY2LjcwMiw1LjA2TDY2LjcwMiw1LjA2eiIvPg0KPC9nPg0KPC9zdmc+DQo=');
|
||||
}
|
||||
|
||||
#footer a:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font: 14px/1.5 monospace;
|
||||
}
|
||||
|
||||
.code {
|
||||
display: block;
|
||||
font: 14px/1.5 monospace;
|
||||
width: 600px;
|
||||
white-space: pre;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
min-height: 110px;
|
||||
}
|
||||
|
||||
#iconlist .new, #iconlist .update {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#iconlist .new:after, #iconlist .update:after {
|
||||
color: #e4c05c;
|
||||
display: block;
|
||||
content: "NEW";
|
||||
font: bold 8px/1 sans-serif;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
text-align: center;
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#iconlist .update:after {
|
||||
content: "UPDATE";
|
||||
left: -1px;
|
||||
}
|
||||
|
||||
body.searching #iconlist span.update:after, body.searching #iconlist span.new:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search {
|
||||
border: 0;
|
||||
border-radius: 2px;
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
font: 11pt sans-serif;
|
||||
padding: 10px;
|
||||
top: 20px;
|
||||
background: rgba(255,255,255,.8);
|
||||
}
|
||||
|
||||
#search:focus {
|
||||
background: #fff;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.genericon-404 {
|
||||
display: none !important; /* This is an easter egg */
|
||||
}
|
||||
|
||||
.genericon:after {
|
||||
content: attr(alt);
|
||||
display: block;
|
||||
font-size: 9px;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hideUACs.genericon:after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and ( max-width: 900px ) {
|
||||
|
||||
#glyph {
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#glyph .info {
|
||||
width: 30%;
|
||||
}
|
||||
#glyph .genericon {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.description {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
background: none;
|
||||
padding-left: 0;
|
||||
float: none;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
/**
|
||||
* Example page JS
|
||||
*/
|
||||
|
||||
function copyToClipboard ( text, copyMode ) {
|
||||
if ( copyMode == "css" ) {
|
||||
window.prompt( "Copy this, then paste in your CSS :before selector.", text );
|
||||
} else if ( copyMode == "html" ) {
|
||||
window.prompt( "Copy this, then paste in your HTML.", text );
|
||||
} else {
|
||||
window.prompt( "Copy this, then paste in your Photoshop textfield.", text );
|
||||
}
|
||||
}
|
||||
|
||||
function pickRandomIcon() {
|
||||
var divs = jQuery("#iconlist div").get().sort(function(){
|
||||
return Math.round(Math.random())-0.5;
|
||||
}).slice(0,1);
|
||||
|
||||
attr = jQuery(divs).attr('alt');
|
||||
cssclass = jQuery(divs).attr('class');
|
||||
displayGlyph( attr, cssclass );
|
||||
|
||||
}
|
||||
|
||||
function displayGlyph( attr, cssclass ) {
|
||||
|
||||
// set permalink
|
||||
var permalink = cssclass.split(' genericon-')[1];
|
||||
window.location.hash = permalink;
|
||||
|
||||
// css copy string
|
||||
csstext = "content: \'\\" + attr + "';";
|
||||
|
||||
// html copy string
|
||||
htmltext = '<span class="' + cssclass + '"></span>';
|
||||
|
||||
// glyph copy string
|
||||
glyphtemp = "&#x" + attr + ";";
|
||||
jQuery('#temp').html( glyphtemp );
|
||||
glyphtext = jQuery('#temp').text();
|
||||
|
||||
// final output
|
||||
output = '<div class="' + cssclass + '"></div>'
|
||||
+ '<div class="info">'
|
||||
+ '<strong>← ' + cssclass.split( ' ' )[1] + '</strong>'
|
||||
+ '<a href="javascript:copyToClipboard(csstext, \'css\')">Copy CSS</a>'
|
||||
+ '<a href="javascript:copyToClipboard(htmltext, \'html\')">Copy HTML</a>'
|
||||
+ '<a href="javascript:copyToClipboard(glyphtext)">Copy Glyph</a>'
|
||||
+ '</div>';
|
||||
|
||||
jQuery( '#glyph' ).html( output );
|
||||
|
||||
}
|
||||
|
||||
function sortUnicode ( a, b ) {
|
||||
var numberA = jQuery(a).attr('alt').replace('f', '');
|
||||
var numberB = jQuery(b).attr('alt').replace('f', '');
|
||||
var contentA =parseInt( numberA, 16 );
|
||||
var contentB =parseInt( numberB, 16 );
|
||||
return (contentA < contentB) ? -1 : (contentA > contentB) ? 1 : 0;
|
||||
}
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
// pick random icon if no permalink, otherwise go to permalink
|
||||
if ( window.location.hash ) {
|
||||
permalink = "genericon-" + window.location.hash.split('#')[1];
|
||||
attr = jQuery( '.' + permalink ).attr( 'alt' );
|
||||
cssclass = jQuery( '.' + permalink ).attr('class');
|
||||
displayGlyph( attr, cssclass );
|
||||
} else {
|
||||
pickRandomIcon();
|
||||
}
|
||||
|
||||
jQuery( '#iconlist div' ).click(function() {
|
||||
|
||||
attr = jQuery( this ).attr( 'alt' );
|
||||
cssclass = jQuery( this ).attr( 'class' );
|
||||
|
||||
displayGlyph( attr, cssclass );
|
||||
|
||||
});
|
||||
|
||||
var $rows = jQuery('#iconlist div');
|
||||
jQuery('#search').keyup(function() {
|
||||
|
||||
// remove update text when using search
|
||||
jQuery('body').addClass('searching');
|
||||
|
||||
var val = jQuery.trim(jQuery(this).val()).replace(/ +/g, ' ').toLowerCase();
|
||||
|
||||
$rows.show().filter(function() {
|
||||
var text = jQuery(this).text().replace(/\s+/g, ' ').toLowerCase();
|
||||
return !~text.indexOf(val);
|
||||
}).hide();
|
||||
});
|
||||
|
||||
jQuery('input#search').focus();
|
||||
|
||||
// sort based on number
|
||||
jQuery('#iconlist div').sort( sortUnicode ).appendTo('#iconlist');
|
||||
|
||||
});
|
||||
|
||||
function toggleUACs() {
|
||||
jQuery('.genericon').toggleClass('hideUACs');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<div id="primary">
|
||||
<div id="content">
|
||||
|
||||
<h2>Genericons <span>— A free, GPL, flexible icon font for blogs!</span></h2>
|
||||
|
||||
<input placeholder="Filter..." name="search" id="search" type="text" value="" maxlength="150" />
|
||||
|
||||
<div id="glyph">
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
<p>Genericons are vector icons embedded in a webfont designed to be clean and simple keeping with a generic aesthetic. Use for instant HiDPI or to easily change colors on the fly.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="icons">
|
||||
<div id="iconlist">
|
||||
|
||||
<!-- note, the text inside the HTML elements is purely for the seach -->
|
||||
|
||||
<div alt="f423" class="genericon genericon-404" title="genericon-404">404</div>
|
||||
|
||||
<div alt="f508" class="genericon genericon-activity" title="genericon-activity">activity</div>
|
||||
|
||||
<div alt="f509" class="genericon genericon-anchor" title="genericon-anchor">anchor</div>
|
||||
|
||||
<div alt="f101" class="genericon genericon-aside" title="genericon-aside">aside</div>
|
||||
|
||||
<div alt="f416" class="genericon genericon-attachment" title="genericon-attachment">attachment</div>
|
||||
|
||||
<div alt="f109" class="genericon genericon-audio" title="genericon-audio">audio</div>
|
||||
|
||||
<div alt="f471" class="genericon genericon-bold" title="genericon-bold">bold</div>
|
||||
|
||||
<div alt="f444" class="genericon genericon-book" title="genericon-book">book</div>
|
||||
|
||||
<div alt="f50a" class="genericon genericon-bug" title="genericon-bug">bug</div>
|
||||
|
||||
<div alt="f447" class="genericon genericon-cart" title="genericon-cart">cart</div>
|
||||
|
||||
<div alt="f301" class="genericon genericon-category" title="genericon-category">category</div>
|
||||
|
||||
<div alt="f108" class="genericon genericon-chat" title="genericon-chat">chat</div>
|
||||
|
||||
<div alt="f418" class="genericon genericon-checkmark" title="genericon-checkmark">checkmark</div>
|
||||
|
||||
<div alt="f405" class="genericon genericon-close" title="genericon-close">close</div>
|
||||
|
||||
<div alt="f406" class="genericon genericon-close-alt" title="genericon-close-alt">close-alt</div>
|
||||
|
||||
<div alt="f426" class="genericon genericon-cloud" title="genericon-cloud">cloud</div>
|
||||
|
||||
<div alt="f440" class="genericon genericon-cloud-download" title="genericon-cloud-download">cloud-download</div>
|
||||
|
||||
<div alt="f441" class="genericon genericon-cloud-upload" title="genericon-cloud-upload">cloud-upload</div>
|
||||
|
||||
<div alt="f462" class="genericon genericon-code" title="genericon-code">code</div>
|
||||
|
||||
<div alt="f216" class="genericon genericon-codepen" title="genericon-codepen">codepen</div>
|
||||
|
||||
<div alt="f445" class="genericon genericon-cog" title="genericon-cog">cog</div>
|
||||
|
||||
<div alt="f432" class="genericon genericon-collapse" title="genericon-collapse">collapse</div>
|
||||
|
||||
<div alt="f300" class="genericon genericon-comment" title="genericon-comment">comment</div>
|
||||
|
||||
<div alt="f305" class="genericon genericon-day" title="genericon-day">day</div>
|
||||
|
||||
<div alt="f221" class="genericon genericon-digg" title="genericon-digg">digg</div>
|
||||
|
||||
<div alt="f443" class="genericon genericon-document" title="genericon-document">document</div>
|
||||
|
||||
<div alt="f428" class="genericon genericon-dot" title="genericon-dot">dot</div>
|
||||
|
||||
<div alt="f502" class="genericon genericon-downarrow" title="genericon-downarrow">downarrow</div>
|
||||
|
||||
<div alt="f50b" class="genericon genericon-download" title="genericon-download">download</div>
|
||||
|
||||
<div alt="f436" class="genericon genericon-draggable" title="genericon-draggable">draggable</div>
|
||||
|
||||
<div alt="f201" class="genericon genericon-dribbble" title="genericon-dribbble">dribbble</div>
|
||||
|
||||
<div alt="f225" class="genericon genericon-dropbox" title="genericon-dropbox">dropbox</div>
|
||||
|
||||
<div alt="f433" class="genericon genericon-dropdown" title="genericon-dropdown">dropdown</div>
|
||||
|
||||
<div alt="f434" class="genericon genericon-dropdown-left" title="genericon-dropdown-left">dropdown-left</div>
|
||||
|
||||
<div alt="f411" class="genericon genericon-edit" title="genericon-edit">edit</div>
|
||||
|
||||
<div alt="f476" class="genericon genericon-ellipsis" title="genericon-ellipsis">ellipsis</div>
|
||||
|
||||
<div alt="f431" class="genericon genericon-expand" title="genericon-expand">expand</div>
|
||||
|
||||
<div alt="f442" class="genericon genericon-external" title="genericon-external">external</div>
|
||||
|
||||
<div alt="f203" class="genericon genericon-facebook" title="genericon-facebook">facebook</div>
|
||||
|
||||
<div alt="f204" class="genericon genericon-facebook-alt" title="genericon-facebook-alt">facebook-alt</div>
|
||||
|
||||
<div alt="f458" class="genericon genericon-fastforward" title="genericon-fastforward">fastforward</div>
|
||||
|
||||
<div alt="f413" class="genericon genericon-feed" title="genericon-feed">feed</div>
|
||||
|
||||
<div alt="f468" class="genericon genericon-flag" title="genericon-flag">flag</div>
|
||||
|
||||
<div alt="f211" class="genericon genericon-flickr" title="genericon-flickr">flickr</div>
|
||||
|
||||
<div alt="f226" class="genericon genericon-foursquare" title="genericon-foursquare">foursquare</div>
|
||||
|
||||
<div alt="f474" class="genericon genericon-fullscreen" title="genericon-fullscreen">fullscreen</div>
|
||||
|
||||
<div alt="f103" class="genericon genericon-gallery" title="genericon-gallery">gallery</div>
|
||||
|
||||
<div alt="f200" class="genericon genericon-github" title="genericon-github">github</div>
|
||||
|
||||
<div alt="f206" class="genericon genericon-googleplus" title="genericon-googleplus">googleplus</div>
|
||||
|
||||
<div alt="f218" class="genericon genericon-googleplus-alt" title="genericon-googleplus-alt">googleplus-alt</div>
|
||||
|
||||
<div alt="f50c" class="genericon genericon-handset" title="genericon-handset">handset</div>
|
||||
|
||||
<div alt="f461" class="genericon genericon-heart" title="genericon-heart">heart</div>
|
||||
|
||||
<div alt="f457" class="genericon genericon-help" title="genericon-help">help</div>
|
||||
|
||||
<div alt="f404" class="genericon genericon-hide" title="genericon-hide">hide</div>
|
||||
|
||||
<div alt="f505" class="genericon genericon-hierarchy" title="genericon-hierarchy">hierarchy</div>
|
||||
|
||||
<div alt="f409" class="genericon genericon-home" title="genericon-home">home</div>
|
||||
|
||||
<div alt="f102" class="genericon genericon-image" title="genericon-image">image</div>
|
||||
|
||||
<div alt="f455" class="genericon genericon-info" title="genericon-info">info</div>
|
||||
|
||||
<div alt="f215" class="genericon genericon-instagram" title="genericon-instagram">instagram</div>
|
||||
|
||||
<div alt="f472" class="genericon genericon-italic" title="genericon-italic">italic</div>
|
||||
|
||||
<div alt="f427" class="genericon genericon-key" title="genericon-key">key</div>
|
||||
|
||||
<div alt="f503" class="genericon genericon-leftarrow" title="genericon-leftarrow">leftarrow</div>
|
||||
|
||||
<div alt="f107" class="genericon genericon-link" title="genericon-link">link</div>
|
||||
|
||||
<div alt="f207" class="genericon genericon-linkedin" title="genericon-linkedin">linkedin</div>
|
||||
|
||||
<div alt="f208" class="genericon genericon-linkedin-alt" title="genericon-linkedin-alt">linkedin-alt</div>
|
||||
|
||||
<div alt="f417" class="genericon genericon-location" title="genericon-location">location</div>
|
||||
|
||||
<div alt="f470" class="genericon genericon-lock" title="genericon-lock">lock</div>
|
||||
|
||||
<div alt="f410" class="genericon genericon-mail" title="genericon-mail">mail</div>
|
||||
|
||||
<div alt="f422" class="genericon genericon-maximize" title="genericon-maximize">maximize</div>
|
||||
|
||||
<div alt="f419" class="genericon genericon-menu" title="genericon-menu">menu</div>
|
||||
|
||||
<div alt="f50d" class="genericon genericon-microphone" title="genericon-microphone">microphone</div>
|
||||
|
||||
<div alt="f421" class="genericon genericon-minimize" title="genericon-minimize">minimize</div>
|
||||
|
||||
<div alt="f50e" class="genericon genericon-minus" title="genericon-minus">minus</div>
|
||||
|
||||
<div alt="f307" class="genericon genericon-month" title="genericon-month">month</div>
|
||||
|
||||
<div alt="f50f" class="genericon genericon-move" title="genericon-move">move</div>
|
||||
|
||||
<div alt="f429" class="genericon genericon-next" title="genericon-next">next</div>
|
||||
|
||||
<div alt="f456" class="genericon genericon-notice" title="genericon-notice">notice</div>
|
||||
|
||||
<div alt="f506" class="genericon genericon-paintbrush" title="genericon-paintbrush">paintbrush</div>
|
||||
|
||||
<div alt="f219" class="genericon genericon-path" title="genericon-path">path</div>
|
||||
|
||||
<div alt="f448" class="genericon genericon-pause" title="genericon-pause">pause</div>
|
||||
|
||||
<div alt="f437" class="genericon genericon-phone" title="genericon-phone">phone</div>
|
||||
|
||||
<div alt="f473" class="genericon genericon-picture" title="genericon-picture">picture</div>
|
||||
|
||||
<div alt="f308" class="genericon genericon-pinned" title="genericon-pinned">pinned</div>
|
||||
|
||||
<div alt="f209" class="genericon genericon-pinterest" title="genericon-pinterest">pinterest</div>
|
||||
|
||||
<div alt="f210" class="genericon genericon-pinterest-alt" title="genericon-pinterest-alt">pinterest-alt</div>
|
||||
|
||||
<div alt="f452" class="genericon genericon-play" title="genericon-play">play</div>
|
||||
|
||||
<div alt="f439" class="genericon genericon-plugin" title="genericon-plugin">plugin</div>
|
||||
|
||||
<div alt="f510" class="genericon genericon-plus" title="genericon-plus">plus</div>
|
||||
|
||||
<div alt="f224" class="genericon genericon-pocket" title="genericon-pocket">pocket</div>
|
||||
|
||||
<div alt="f217" class="genericon genericon-polldaddy" title="genericon-polldaddy">polldaddy</div>
|
||||
|
||||
<div alt="f460" class="genericon genericon-portfolio" title="genericon-portfolio">portfolio</div>
|
||||
|
||||
<div alt="f430" class="genericon genericon-previous" title="genericon-previous">previous</div>
|
||||
|
||||
<div alt="f469" class="genericon genericon-print" title="genericon-print">print</div>
|
||||
|
||||
<div alt="f106" class="genericon genericon-quote" title="genericon-quote">quote</div>
|
||||
|
||||
<div alt="f511" class="genericon genericon-rating-empty" title="genericon-rating-empty">rating-empty</div>
|
||||
|
||||
<div alt="f512" class="genericon genericon-rating-full" title="genericon-rating-full">rating-full</div>
|
||||
|
||||
<div alt="f513" class="genericon genericon-rating-half" title="genericon-rating-half">rating-half</div>
|
||||
|
||||
<div alt="f222" class="genericon genericon-reddit" title="genericon-reddit">reddit</div>
|
||||
|
||||
<div alt="f420" class="genericon genericon-refresh" title="genericon-refresh">refresh</div>
|
||||
|
||||
<div alt="f412" class="genericon genericon-reply" title="genericon-reply">reply</div>
|
||||
|
||||
<div alt="f466" class="genericon genericon-reply-alt" title="genericon-reply-alt">reply-alt</div>
|
||||
|
||||
<div alt="f467" class="genericon genericon-reply-single" title="genericon-reply-single">reply-single</div>
|
||||
|
||||
<div alt="f459" class="genericon genericon-rewind" title="genericon-rewind">rewind</div>
|
||||
|
||||
<div alt="f501" class="genericon genericon-rightarrow" title="genericon-rightarrow">rightarrow</div>
|
||||
|
||||
<div alt="f400" class="genericon genericon-search" title="genericon-search">search</div>
|
||||
|
||||
<div alt="f438" class="genericon genericon-send-to-phone" title="genericon-send-to-phone">send-to-phone</div>
|
||||
|
||||
<div alt="f454" class="genericon genericon-send-to-tablet" title="genericon-send-to-tablet">send-to-tablet</div>
|
||||
|
||||
<div alt="f415" class="genericon genericon-share" title="genericon-share">share</div>
|
||||
|
||||
<div alt="f403" class="genericon genericon-show" title="genericon-show">show</div>
|
||||
|
||||
<div alt="f514" class="genericon genericon-shuffle" title="genericon-shuffle">shuffle</div>
|
||||
|
||||
<div alt="f507" class="genericon genericon-sitemap" title="genericon-sitemap">sitemap</div>
|
||||
|
||||
<div alt="f451" class="genericon genericon-skip-ahead" title="genericon-skip-ahead">skip-ahead</div>
|
||||
|
||||
<div alt="f450" class="genericon genericon-skip-back" title="genericon-skip-back">skip-back</div>
|
||||
|
||||
<div alt="f220" class="genericon genericon-skype" title="genericon-skype">skype</div>
|
||||
|
||||
<div alt="f424" class="genericon genericon-spam" title="genericon-spam">spam</div>
|
||||
|
||||
<div alt="f515" class="genericon genericon-spotify" title="genericon-spotify">spotify</div>
|
||||
|
||||
<div alt="f100" class="genericon genericon-standard" title="genericon-standard">standard</div>
|
||||
|
||||
<div alt="f408" class="genericon genericon-star" title="genericon-star">star</div>
|
||||
|
||||
<div alt="f105" class="genericon genericon-status" title="genericon-status">status</div>
|
||||
|
||||
<div alt="f449" class="genericon genericon-stop" title="genericon-stop">stop</div>
|
||||
|
||||
<div alt="f223" class="genericon genericon-stumbleupon" title="genericon-stumbleupon">stumbleupon</div>
|
||||
|
||||
<div alt="f463" class="genericon genericon-subscribe" title="genericon-subscribe">subscribe</div>
|
||||
|
||||
<div alt="f465" class="genericon genericon-subscribed" title="genericon-subscribed">subscribed</div>
|
||||
|
||||
<div alt="f425" class="genericon genericon-summary" title="genericon-summary">summary</div>
|
||||
|
||||
<div alt="f453" class="genericon genericon-tablet" title="genericon-tablet">tablet</div>
|
||||
|
||||
<div alt="f302" class="genericon genericon-tag" title="genericon-tag">tag</div>
|
||||
|
||||
<div alt="f303" class="genericon genericon-time" title="genericon-time">time</div>
|
||||
|
||||
<div alt="f435" class="genericon genericon-top" title="genericon-top">top</div>
|
||||
|
||||
<div alt="f407" class="genericon genericon-trash" title="genericon-trash">trash</div>
|
||||
|
||||
<div alt="f214" class="genericon genericon-tumblr" title="genericon-tumblr">tumblr</div>
|
||||
|
||||
<div alt="f516" class="genericon genericon-twitch" title="genericon-twitch">twitch</div>
|
||||
|
||||
<div alt="f202" class="genericon genericon-twitter" title="genericon-twitter">twitter</div>
|
||||
|
||||
<div alt="f446" class="genericon genericon-unapprove" title="genericon-unapprove">unapprove</div>
|
||||
|
||||
<div alt="f464" class="genericon genericon-unsubscribe" title="genericon-unsubscribe">unsubscribe</div>
|
||||
|
||||
<div alt="f401" class="genericon genericon-unzoom" title="genericon-unzoom">unzoom</div>
|
||||
|
||||
<div alt="f500" class="genericon genericon-uparrow" title="genericon-uparrow">uparrow</div>
|
||||
|
||||
<div alt="f304" class="genericon genericon-user" title="genericon-user">user</div>
|
||||
|
||||
<div alt="f104" class="genericon genericon-video" title="genericon-video">video</div>
|
||||
|
||||
<div alt="f517" class="genericon genericon-videocamera" title="genericon-videocamera">videocamera</div>
|
||||
|
||||
<div alt="f212" class="genericon genericon-vimeo" title="genericon-vimeo">vimeo</div>
|
||||
|
||||
<div alt="f414" class="genericon genericon-warning" title="genericon-warning">warning</div>
|
||||
|
||||
<div alt="f475" class="genericon genericon-website" title="genericon-website">website</div>
|
||||
|
||||
<div alt="f306" class="genericon genericon-week" title="genericon-week">week</div>
|
||||
|
||||
<div alt="f205" class="genericon genericon-wordpress" title="genericon-wordpress">wordpress</div>
|
||||
|
||||
<div alt="f504" class="genericon genericon-xpost" title="genericon-xpost">xpost</div>
|
||||
|
||||
<div alt="f213" class="genericon genericon-youtube" title="genericon-youtube">youtube</div>
|
||||
|
||||
<div alt="f402" class="genericon genericon-zoom" title="genericon-zoom">zoom</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="temp" style="display: none;"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
|
||||
<p>An <a href="http://automattic.com" rel="nofollow">Automattic</a> Portrayal</p>
|
||||
<p>No designers were harmed in the making of this icon font.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfifteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
|
||||
Version: 1.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, blue, gray, pink, purple, white, yellow, dark, light, two-columns, left-sidebar, fixed-layout, responsive-layout, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
|
||||
|
||||
@@ -1,464 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<title>Genericons</title>
|
||||
<link rel="stylesheet" href="genericons.css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.5;
|
||||
width: 800px;
|
||||
margin: 50px auto;
|
||||
color: #777;
|
||||
background: white;
|
||||
}
|
||||
.icons {
|
||||
overflow: hidden;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.icons div {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
margin: 0 30px 30px 0;
|
||||
}
|
||||
.icons:hover div {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
.code {
|
||||
display: block;
|
||||
font: 14px/1.5 monospace;
|
||||
width: 740px;
|
||||
white-space: pre;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
color: #777;
|
||||
overflow: auto;
|
||||
}
|
||||
.my-icon:before {
|
||||
content: '\f408';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}
|
||||
/* For the Examples */
|
||||
.my-checklist {
|
||||
list-style-type: none;
|
||||
text-indent: -16px;
|
||||
}
|
||||
.my-checklist li:before {
|
||||
padding-right: 16px;
|
||||
content: '\f418';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: text-top;
|
||||
}
|
||||
.my-blockquote {
|
||||
background: #eee;
|
||||
border-left: 32px solid #ddd;
|
||||
padding: 10px;
|
||||
}
|
||||
.my-blockquote:before {
|
||||
margin-left: -42px;
|
||||
padding-right: 10px;
|
||||
content: '\f106';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/20px 'Genericons';
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.my-button {
|
||||
font-family: Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
background: #e05d22; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
|
||||
display: inline-block;
|
||||
padding: 10px 16px 4px 16px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-bottom: 3px solid #b93207;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.my-button:hover,
|
||||
.my-button:focus {
|
||||
background: #ed6a31; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
|
||||
outline: none;
|
||||
}
|
||||
.my-button:active {
|
||||
background: #d94412; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
|
||||
border: none;
|
||||
border-top: 3px solid #b93207;
|
||||
padding: 6px 16px 7px 16px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="section">
|
||||
|
||||
<h1>Genericons Usage</h1>
|
||||
|
||||
<p>Copy the <strong>font</strong> folder and the <strong>genericons.css</strong> file together into your project. Link the CSS in your HTML:</p>
|
||||
|
||||
<p><code><link href="path/to/genericons.css" rel="stylesheet"></code></p>
|
||||
|
||||
<p>Drop in the following HTML with the name of the icon you want to display:</p>
|
||||
|
||||
<p><code><div class="genericon genericon-standard"></div></code></p>
|
||||
|
||||
<div class="icons">
|
||||
|
||||
<!-- post formats -->
|
||||
<div alt="f100" class="genericon genericon-standard"></div>
|
||||
<div alt="f101" class="genericon genericon-aside"></div>
|
||||
<div alt="f102" class="genericon genericon-image"></div>
|
||||
<div alt="f103" class="genericon genericon-gallery"></div>
|
||||
<div alt="f104" class="genericon genericon-video"></div>
|
||||
<div alt="f105" class="genericon genericon-status"></div>
|
||||
<div alt="f106" class="genericon genericon-quote"></div>
|
||||
<div alt="f107" class="genericon genericon-link"></div>
|
||||
<div alt="f108" class="genericon genericon-chat"></div>
|
||||
<div alt="f109" class="genericon genericon-audio"></div>
|
||||
|
||||
<!-- social icons -->
|
||||
<div alt="f200" class="genericon genericon-github"></div>
|
||||
<div alt="f201" class="genericon genericon-dribbble"></div>
|
||||
<div alt="f202" class="genericon genericon-twitter"></div>
|
||||
<div alt="f203" class="genericon genericon-facebook"></div>
|
||||
<div alt="f204" class="genericon genericon-facebook-alt"></div>
|
||||
<div alt="f205" class="genericon genericon-wordpress"></div>
|
||||
<div alt="f206" class="genericon genericon-googleplus"></div>
|
||||
<div alt="f207" class="genericon genericon-linkedin"></div>
|
||||
<div alt="f208" class="genericon genericon-linkedin-alt"></div>
|
||||
<div alt="f209" class="genericon genericon-pinterest"></div>
|
||||
<div alt="f210" class="genericon genericon-pinterest-alt"></div>
|
||||
<div alt="f211" class="genericon genericon-flickr"></div>
|
||||
<div alt="f212" class="genericon genericon-vimeo"></div>
|
||||
<div alt="f213" class="genericon genericon-youtube"></div>
|
||||
<div alt="f214" class="genericon genericon-tumblr"></div>
|
||||
<div alt="f215" class="genericon genericon-instagram"></div>
|
||||
<div alt="f216" class="genericon genericon-codepen"></div>
|
||||
<div alt="f217" class="genericon genericon-polldaddy"></div>
|
||||
<div alt="f218" class="genericon genericon-googleplus-alt"></div>
|
||||
<div alt="f219" class="genericon genericon-path"></div>
|
||||
<div alt="f220" class="genericon genericon-skype"></div>
|
||||
<div alt="f221" class="genericon genericon-digg"></div>
|
||||
<div alt="f222" class="genericon genericon-reddit"></div>
|
||||
<div alt="f223" class="genericon genericon-stumbleupon"></div>
|
||||
<div alt="f224" class="genericon genericon-pocket"></div>
|
||||
<div alt="f225" class="genericon genericon-dropbox"></div>
|
||||
|
||||
<!-- meta icons -->
|
||||
<div alt="f300" class="genericon genericon-comment"></div>
|
||||
<div alt="f301" class="genericon genericon-category"></div>
|
||||
<div alt="f302" class="genericon genericon-tag"></div>
|
||||
<div alt="f303" class="genericon genericon-time"></div>
|
||||
<div alt="f304" class="genericon genericon-user"></div>
|
||||
<div alt="f305" class="genericon genericon-day"></div>
|
||||
<div alt="f306" class="genericon genericon-week"></div>
|
||||
<div alt="f307" class="genericon genericon-month"></div>
|
||||
<div alt="f308" class="genericon genericon-pinned"></div>
|
||||
|
||||
<!-- other icons -->
|
||||
<div alt="f400" class="genericon genericon-search"></div>
|
||||
<div alt="f401" class="genericon genericon-unzoom"></div>
|
||||
<div alt="f402" class="genericon genericon-zoom"></div>
|
||||
<div alt="f403" class="genericon genericon-show"></div>
|
||||
<div alt="f404" class="genericon genericon-hide"></div>
|
||||
<div alt="f405" class="genericon genericon-close"></div>
|
||||
<div alt="f406" class="genericon genericon-close-alt"></div>
|
||||
<div alt="f407" class="genericon genericon-trash"></div>
|
||||
<div alt="f408" class="genericon genericon-star"></div>
|
||||
<div alt="f409" class="genericon genericon-home"></div>
|
||||
<div alt="f410" class="genericon genericon-mail"></div>
|
||||
<div alt="f411" class="genericon genericon-edit"></div>
|
||||
<div alt="f412" class="genericon genericon-reply"></div>
|
||||
<div alt="f413" class="genericon genericon-feed"></div>
|
||||
<div alt="f414" class="genericon genericon-warning"></div>
|
||||
<div alt="f415" class="genericon genericon-share"></div>
|
||||
<div alt="f416" class="genericon genericon-attachment"></div>
|
||||
<div alt="f417" class="genericon genericon-location"></div>
|
||||
<div alt="f418" class="genericon genericon-checkmark"></div>
|
||||
<div alt="f419" class="genericon genericon-menu"></div>
|
||||
<div alt="f420" class="genericon genericon-refresh"></div>
|
||||
<div alt="f421" class="genericon genericon-minimize"></div>
|
||||
<div alt="f422" class="genericon genericon-maximize"></div>
|
||||
<div alt="f423" class="genericon genericon-404"></div>
|
||||
<div alt="f424" class="genericon genericon-spam"></div>
|
||||
<div alt="f425" class="genericon genericon-summary"></div>
|
||||
<div alt="f426" class="genericon genericon-cloud"></div>
|
||||
<div alt="f427" class="genericon genericon-key"></div>
|
||||
<div alt="f428" class="genericon genericon-dot"></div>
|
||||
<div alt="f429" class="genericon genericon-next"></div>
|
||||
<div alt="f430" class="genericon genericon-previous"></div>
|
||||
<div alt="f431" class="genericon genericon-expand"></div>
|
||||
<div alt="f432" class="genericon genericon-collapse"></div>
|
||||
<div alt="f433" class="genericon genericon-dropdown"></div>
|
||||
<div alt="f434" class="genericon genericon-dropdown-left"></div>
|
||||
<div alt="f435" class="genericon genericon-top"></div>
|
||||
<div alt="f436" class="genericon genericon-draggable"></div>
|
||||
<div alt="f437" class="genericon genericon-phone"></div>
|
||||
<div alt="f438" class="genericon genericon-send-to-phone"></div>
|
||||
<div alt="f439" class="genericon genericon-plugin"></div>
|
||||
<div alt="f440" class="genericon genericon-cloud-download"></div>
|
||||
<div alt="f441" class="genericon genericon-cloud-upload"></div>
|
||||
<div alt="f442" class="genericon genericon-external"></div>
|
||||
<div alt="f443" class="genericon genericon-document"></div>
|
||||
<div alt="f444" class="genericon genericon-book"></div>
|
||||
<div alt="f445" class="genericon genericon-cog"></div>
|
||||
<div alt="f446" class="genericon genericon-unapprove"></div>
|
||||
<div alt="f447" class="genericon genericon-cart"></div>
|
||||
<div alt="f448" class="genericon genericon-pause"></div>
|
||||
<div alt="f449" class="genericon genericon-stop"></div>
|
||||
<div alt="f450" class="genericon genericon-skip-back"></div>
|
||||
<div alt="f451" class="genericon genericon-skip-ahead"></div>
|
||||
<div alt="f452" class="genericon genericon-play"></div>
|
||||
<div alt="f453" class="genericon genericon-tablet"></div>
|
||||
<div alt="f454" class="genericon genericon-send-to-tablet"></div>
|
||||
<div alt="f455" class="genericon genericon-info"></div>
|
||||
<div alt="f456" class="genericon genericon-notice"></div>
|
||||
<div alt="f457" class="genericon genericon-help"></div>
|
||||
<div alt="f458" class="genericon genericon-fastforward"></div>
|
||||
<div alt="f459" class="genericon genericon-rewind"></div>
|
||||
<div alt="f460" class="genericon genericon-portfolio"></div>
|
||||
<div alt="f461" class="genericon genericon-heart"></div>
|
||||
<div alt="f462" class="genericon genericon-code"></div>
|
||||
<div alt="f463" class="genericon genericon-subscribe"></div>
|
||||
<div alt="f464" class="genericon genericon-unsubscribe"></div>
|
||||
<div alt="f465" class="genericon genericon-subscribed"></div>
|
||||
<div alt="f466" class="genericon genericon-reply-alt"></div>
|
||||
<div alt="f467" class="genericon genericon-reply-single"></div>
|
||||
<div alt="f468" class="genericon genericon-flag"></div>
|
||||
<div alt="f469" class="genericon genericon-print"></div>
|
||||
<div alt="f470" class="genericon genericon-lock"></div>
|
||||
<div alt="f471" class="genericon genericon-bold"></div>
|
||||
<div alt="f472" class="genericon genericon-italic"></div>
|
||||
<div alt="f473" class="genericon genericon-picture"></div>
|
||||
<div alt="f474" class="genericon genericon-fullscreen"></div>
|
||||
|
||||
<!-- generic shapes -->
|
||||
<div alt="f500" class="genericon genericon-uparrow"></div>
|
||||
<div alt="f501" class="genericon genericon-rightarrow"></div>
|
||||
<div alt="f502" class="genericon genericon-downarrow"></div>
|
||||
<div alt="f503" class="genericon genericon-leftarrow"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<p>If you want to insert an icon manually using the <code>:before</code> selector, you can setup CSS rules like the following example. <strong>Make sure to set the size to a multiple of 16px</strong> or the icons could end up looking fuzzy:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 150px;" onclick="select();">.my-icon:before {
|
||||
content: '\f408';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Add a matching class to your HTML:</p>
|
||||
|
||||
<p><code><div class="my-icon">You're a Star!</div></code></p>
|
||||
|
||||
<p>Here's the result: <span class="my-icon">You're a Star!</span></p>
|
||||
|
||||
<h2>Examples</h2>
|
||||
|
||||
<p>Turn every icon a <span style="color: #fa8072;">Salmon</span> color:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 70px" onclick="select();">
|
||||
.genericon {
|
||||
color: #fa8072;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Or turn the stars <span style="color: #ffd700;">Gold</span>:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 70px" onclick="select();">
|
||||
.genericon-star {
|
||||
color: #fa8072;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Use icons for bulleted lists:</p>
|
||||
|
||||
<ul class="my-checklist">
|
||||
<li>One</li>
|
||||
<li>Two</li>
|
||||
<li>Three</li>
|
||||
<li>Four</li>
|
||||
</ul>
|
||||
|
||||
<p><textarea class="code" style="min-height: 130px" onclick="select();">
|
||||
<ul class="my-checklist">
|
||||
<li>One</li>
|
||||
<li>Two</li>
|
||||
<li>Three</li>
|
||||
<li>Four</li>
|
||||
</ul></textarea></p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 260px;" onclick="select();">
|
||||
.my-checklist {
|
||||
list-style-type: none;
|
||||
text-indent: -16px;
|
||||
}
|
||||
.my-checklist li:before {
|
||||
padding-right: 16px;
|
||||
content: '\f418';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: text-top;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Use icons to style blockquotes:</p>
|
||||
|
||||
<blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. —<em>Lewis Carroll</em></blockquote>
|
||||
<blockquote class="my-blockquote">`Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!"</blockquote>
|
||||
|
||||
<p><textarea class="code" style="min-height: 40px;" onclick="select();"><blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. —<em>Lewis Carroll</em></blockquote></textarea></p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 300px;" onclick="select();">
|
||||
.my-blockquote {
|
||||
background: #eee;
|
||||
border-left: 32px solid #ddd;
|
||||
padding: 10px;
|
||||
}
|
||||
.my-blockquote:before {
|
||||
margin-left: -42px;
|
||||
padding-right: 10px;
|
||||
content: '\f106';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/20px 'Genericons';
|
||||
vertical-align: bottom;
|
||||
} </textarea></p>
|
||||
|
||||
<p>Use icons to style buttons:</p>
|
||||
|
||||
<a class="my-button" href="javascript:void()"><i class="genericon genericon-show"></i> View</a>
|
||||
<a class="my-button" href="javascript:void()"><i class="genericon genericon-audio"></i> Listen</a>
|
||||
|
||||
<p><textarea class="code" style="min-height: 40px;" onclick="select();"><a class="my-button" href="#"><i class="genericon genericon-show"></i> View</a>
|
||||
<a class="my-button" href="#"><i class="genericon genericon-audio"></i> Listen</a></textarea></p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 300px;" onclick="select();">
|
||||
.my-button {
|
||||
font-family: Helvetica, sans-serif;
|
||||
background: #e05d22; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
|
||||
display: inline-block;
|
||||
padding: 10px 16px 6px 16px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-bottom: 3px solid #b93207;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.my-button:hover,
|
||||
.my-button:focus {
|
||||
background: #ed6a31; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.my-button:active {
|
||||
background: #d94412; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
|
||||
border: none;
|
||||
border-top: 3px solid #b93207;
|
||||
padding: 6px 16px 10px 16px;
|
||||
}</textarea>/</p>
|
||||
|
||||
<h2>CSS Preprocessors</h2>
|
||||
|
||||
<p>Preprocessing extensions such as Sass (SCSS Syntax) or LESS</a> can make it easier to manage CSS for a lot of things at once using things like variables and mixins.</p>
|
||||
|
||||
<p>This example will seup the basic genericon rules and sets a color you can use for all icons using Sass:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 360px;" onclick="select();">$icon-color: "#fa8072";
|
||||
|
||||
.genericon {
|
||||
color: $icon-color;
|
||||
}
|
||||
|
||||
@mixin genericon-rules {
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.my-icon:before {
|
||||
content: '\f408';
|
||||
@include genericon-rules;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Here is a similar example for LESS:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 360px;" onclick="select();">@icon-color: "#fa8072";
|
||||
|
||||
.genericon {
|
||||
color: @icon-color;
|
||||
}
|
||||
|
||||
.genericon-rules {
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.my-icon:before {
|
||||
content: '\f408';
|
||||
.genericon-rules;
|
||||
}</textarea></p>
|
||||
|
||||
<h2>Fallback images for IE7 and below</h2>
|
||||
|
||||
<p>Genericons <strong>does not come with fallback icons by default</strong> -- therefore you have to create them yourself. If you are using HTML similar to this example:
|
||||
|
||||
<p><code><span class="genericon genericon-warning"></span></code></p>
|
||||
|
||||
<p>You can use the asterisk hack to serve a different icon to IE7 once you have saved the fallback icons to your project:</p>
|
||||
|
||||
<textarea class="code" style="min-height: 85px;" onclick="select();">.genericon-warning {
|
||||
*background: url(fallback-icon.png) no-repeat center center;
|
||||
*text-indent: 100%;
|
||||
}</textarea>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,464 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<title>Genericons</title>
|
||||
<link rel="stylesheet" href="genericons.css">
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.5;
|
||||
width: 800px;
|
||||
margin: 50px auto;
|
||||
color: #777;
|
||||
background: white;
|
||||
}
|
||||
.icons {
|
||||
overflow: hidden;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.icons div {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
margin: 0 30px 30px 0;
|
||||
}
|
||||
.icons:hover div {
|
||||
background: #f7f7f7;
|
||||
}
|
||||
.code {
|
||||
display: block;
|
||||
font: 14px/1.5 monospace;
|
||||
width: 740px;
|
||||
white-space: pre;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px;
|
||||
color: #777;
|
||||
overflow: auto;
|
||||
}
|
||||
.my-icon:before {
|
||||
content: '\f408';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}
|
||||
/* For the Examples */
|
||||
.my-checklist {
|
||||
list-style-type: none;
|
||||
text-indent: -16px;
|
||||
}
|
||||
.my-checklist li:before {
|
||||
padding-right: 16px;
|
||||
content: '\f418';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: text-top;
|
||||
}
|
||||
.my-blockquote {
|
||||
background: #eee;
|
||||
border-left: 32px solid #ddd;
|
||||
padding: 10px;
|
||||
}
|
||||
.my-blockquote:before {
|
||||
margin-left: -42px;
|
||||
padding-right: 10px;
|
||||
content: '\f106';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/20px 'Genericons';
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.my-button {
|
||||
font-family: Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
background: #e05d22; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
|
||||
display: inline-block;
|
||||
padding: 10px 16px 4px 16px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-bottom: 3px solid #b93207;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.my-button:hover,
|
||||
.my-button:focus {
|
||||
background: #ed6a31; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
|
||||
outline: none;
|
||||
}
|
||||
.my-button:active {
|
||||
background: #d94412; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
|
||||
border: none;
|
||||
border-top: 3px solid #b93207;
|
||||
padding: 6px 16px 7px 16px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="section">
|
||||
|
||||
<h1>Genericons Usage</h1>
|
||||
|
||||
<p>Copy the <strong>font</strong> folder and the <strong>genericons.css</strong> file together into your project. Link the CSS in your HTML:</p>
|
||||
|
||||
<p><code><link href="path/to/genericons.css" rel="stylesheet"></code></p>
|
||||
|
||||
<p>Drop in the following HTML with the name of the icon you want to display:</p>
|
||||
|
||||
<p><code><div class="genericon genericon-standard"></div></code></p>
|
||||
|
||||
<div class="icons">
|
||||
|
||||
<!-- post formats -->
|
||||
<div alt="f100" class="genericon genericon-standard"></div>
|
||||
<div alt="f101" class="genericon genericon-aside"></div>
|
||||
<div alt="f102" class="genericon genericon-image"></div>
|
||||
<div alt="f103" class="genericon genericon-gallery"></div>
|
||||
<div alt="f104" class="genericon genericon-video"></div>
|
||||
<div alt="f105" class="genericon genericon-status"></div>
|
||||
<div alt="f106" class="genericon genericon-quote"></div>
|
||||
<div alt="f107" class="genericon genericon-link"></div>
|
||||
<div alt="f108" class="genericon genericon-chat"></div>
|
||||
<div alt="f109" class="genericon genericon-audio"></div>
|
||||
|
||||
<!-- social icons -->
|
||||
<div alt="f200" class="genericon genericon-github"></div>
|
||||
<div alt="f201" class="genericon genericon-dribbble"></div>
|
||||
<div alt="f202" class="genericon genericon-twitter"></div>
|
||||
<div alt="f203" class="genericon genericon-facebook"></div>
|
||||
<div alt="f204" class="genericon genericon-facebook-alt"></div>
|
||||
<div alt="f205" class="genericon genericon-wordpress"></div>
|
||||
<div alt="f206" class="genericon genericon-googleplus"></div>
|
||||
<div alt="f207" class="genericon genericon-linkedin"></div>
|
||||
<div alt="f208" class="genericon genericon-linkedin-alt"></div>
|
||||
<div alt="f209" class="genericon genericon-pinterest"></div>
|
||||
<div alt="f210" class="genericon genericon-pinterest-alt"></div>
|
||||
<div alt="f211" class="genericon genericon-flickr"></div>
|
||||
<div alt="f212" class="genericon genericon-vimeo"></div>
|
||||
<div alt="f213" class="genericon genericon-youtube"></div>
|
||||
<div alt="f214" class="genericon genericon-tumblr"></div>
|
||||
<div alt="f215" class="genericon genericon-instagram"></div>
|
||||
<div alt="f216" class="genericon genericon-codepen"></div>
|
||||
<div alt="f217" class="genericon genericon-polldaddy"></div>
|
||||
<div alt="f218" class="genericon genericon-googleplus-alt"></div>
|
||||
<div alt="f219" class="genericon genericon-path"></div>
|
||||
<div alt="f220" class="genericon genericon-skype"></div>
|
||||
<div alt="f221" class="genericon genericon-digg"></div>
|
||||
<div alt="f222" class="genericon genericon-reddit"></div>
|
||||
<div alt="f223" class="genericon genericon-stumbleupon"></div>
|
||||
<div alt="f224" class="genericon genericon-pocket"></div>
|
||||
<div alt="f225" class="genericon genericon-dropbox"></div>
|
||||
|
||||
<!-- meta icons -->
|
||||
<div alt="f300" class="genericon genericon-comment"></div>
|
||||
<div alt="f301" class="genericon genericon-category"></div>
|
||||
<div alt="f302" class="genericon genericon-tag"></div>
|
||||
<div alt="f303" class="genericon genericon-time"></div>
|
||||
<div alt="f304" class="genericon genericon-user"></div>
|
||||
<div alt="f305" class="genericon genericon-day"></div>
|
||||
<div alt="f306" class="genericon genericon-week"></div>
|
||||
<div alt="f307" class="genericon genericon-month"></div>
|
||||
<div alt="f308" class="genericon genericon-pinned"></div>
|
||||
|
||||
<!-- other icons -->
|
||||
<div alt="f400" class="genericon genericon-search"></div>
|
||||
<div alt="f401" class="genericon genericon-unzoom"></div>
|
||||
<div alt="f402" class="genericon genericon-zoom"></div>
|
||||
<div alt="f403" class="genericon genericon-show"></div>
|
||||
<div alt="f404" class="genericon genericon-hide"></div>
|
||||
<div alt="f405" class="genericon genericon-close"></div>
|
||||
<div alt="f406" class="genericon genericon-close-alt"></div>
|
||||
<div alt="f407" class="genericon genericon-trash"></div>
|
||||
<div alt="f408" class="genericon genericon-star"></div>
|
||||
<div alt="f409" class="genericon genericon-home"></div>
|
||||
<div alt="f410" class="genericon genericon-mail"></div>
|
||||
<div alt="f411" class="genericon genericon-edit"></div>
|
||||
<div alt="f412" class="genericon genericon-reply"></div>
|
||||
<div alt="f413" class="genericon genericon-feed"></div>
|
||||
<div alt="f414" class="genericon genericon-warning"></div>
|
||||
<div alt="f415" class="genericon genericon-share"></div>
|
||||
<div alt="f416" class="genericon genericon-attachment"></div>
|
||||
<div alt="f417" class="genericon genericon-location"></div>
|
||||
<div alt="f418" class="genericon genericon-checkmark"></div>
|
||||
<div alt="f419" class="genericon genericon-menu"></div>
|
||||
<div alt="f420" class="genericon genericon-refresh"></div>
|
||||
<div alt="f421" class="genericon genericon-minimize"></div>
|
||||
<div alt="f422" class="genericon genericon-maximize"></div>
|
||||
<div alt="f423" class="genericon genericon-404"></div>
|
||||
<div alt="f424" class="genericon genericon-spam"></div>
|
||||
<div alt="f425" class="genericon genericon-summary"></div>
|
||||
<div alt="f426" class="genericon genericon-cloud"></div>
|
||||
<div alt="f427" class="genericon genericon-key"></div>
|
||||
<div alt="f428" class="genericon genericon-dot"></div>
|
||||
<div alt="f429" class="genericon genericon-next"></div>
|
||||
<div alt="f430" class="genericon genericon-previous"></div>
|
||||
<div alt="f431" class="genericon genericon-expand"></div>
|
||||
<div alt="f432" class="genericon genericon-collapse"></div>
|
||||
<div alt="f433" class="genericon genericon-dropdown"></div>
|
||||
<div alt="f434" class="genericon genericon-dropdown-left"></div>
|
||||
<div alt="f435" class="genericon genericon-top"></div>
|
||||
<div alt="f436" class="genericon genericon-draggable"></div>
|
||||
<div alt="f437" class="genericon genericon-phone"></div>
|
||||
<div alt="f438" class="genericon genericon-send-to-phone"></div>
|
||||
<div alt="f439" class="genericon genericon-plugin"></div>
|
||||
<div alt="f440" class="genericon genericon-cloud-download"></div>
|
||||
<div alt="f441" class="genericon genericon-cloud-upload"></div>
|
||||
<div alt="f442" class="genericon genericon-external"></div>
|
||||
<div alt="f443" class="genericon genericon-document"></div>
|
||||
<div alt="f444" class="genericon genericon-book"></div>
|
||||
<div alt="f445" class="genericon genericon-cog"></div>
|
||||
<div alt="f446" class="genericon genericon-unapprove"></div>
|
||||
<div alt="f447" class="genericon genericon-cart"></div>
|
||||
<div alt="f448" class="genericon genericon-pause"></div>
|
||||
<div alt="f449" class="genericon genericon-stop"></div>
|
||||
<div alt="f450" class="genericon genericon-skip-back"></div>
|
||||
<div alt="f451" class="genericon genericon-skip-ahead"></div>
|
||||
<div alt="f452" class="genericon genericon-play"></div>
|
||||
<div alt="f453" class="genericon genericon-tablet"></div>
|
||||
<div alt="f454" class="genericon genericon-send-to-tablet"></div>
|
||||
<div alt="f455" class="genericon genericon-info"></div>
|
||||
<div alt="f456" class="genericon genericon-notice"></div>
|
||||
<div alt="f457" class="genericon genericon-help"></div>
|
||||
<div alt="f458" class="genericon genericon-fastforward"></div>
|
||||
<div alt="f459" class="genericon genericon-rewind"></div>
|
||||
<div alt="f460" class="genericon genericon-portfolio"></div>
|
||||
<div alt="f461" class="genericon genericon-heart"></div>
|
||||
<div alt="f462" class="genericon genericon-code"></div>
|
||||
<div alt="f463" class="genericon genericon-subscribe"></div>
|
||||
<div alt="f464" class="genericon genericon-unsubscribe"></div>
|
||||
<div alt="f465" class="genericon genericon-subscribed"></div>
|
||||
<div alt="f466" class="genericon genericon-reply-alt"></div>
|
||||
<div alt="f467" class="genericon genericon-reply-single"></div>
|
||||
<div alt="f468" class="genericon genericon-flag"></div>
|
||||
<div alt="f469" class="genericon genericon-print"></div>
|
||||
<div alt="f470" class="genericon genericon-lock"></div>
|
||||
<div alt="f471" class="genericon genericon-bold"></div>
|
||||
<div alt="f472" class="genericon genericon-italic"></div>
|
||||
<div alt="f473" class="genericon genericon-picture"></div>
|
||||
<div alt="f474" class="genericon genericon-fullscreen"></div>
|
||||
|
||||
<!-- generic shapes -->
|
||||
<div alt="f500" class="genericon genericon-uparrow"></div>
|
||||
<div alt="f501" class="genericon genericon-rightarrow"></div>
|
||||
<div alt="f502" class="genericon genericon-downarrow"></div>
|
||||
<div alt="f503" class="genericon genericon-leftarrow"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<p>If you want to insert an icon manually using the <code>:before</code> selector, you can setup CSS rules like the following example. <strong>Make sure to set the size to a multiple of 16px</strong> or the icons could end up looking fuzzy:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 150px;" onclick="select();">.my-icon:before {
|
||||
content: '\f408';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Add a matching class to your HTML:</p>
|
||||
|
||||
<p><code><div class="my-icon">You're a Star!</div></code></p>
|
||||
|
||||
<p>Here's the result: <span class="my-icon">You're a Star!</span></p>
|
||||
|
||||
<h2>Examples</h2>
|
||||
|
||||
<p>Turn every icon a <span style="color: #fa8072;">Salmon</span> color:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 70px" onclick="select();">
|
||||
.genericon {
|
||||
color: #fa8072;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Or turn the stars <span style="color: #ffd700;">Gold</span>:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 70px" onclick="select();">
|
||||
.genericon-star {
|
||||
color: #fa8072;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Use icons for bulleted lists:</p>
|
||||
|
||||
<ul class="my-checklist">
|
||||
<li>One</li>
|
||||
<li>Two</li>
|
||||
<li>Three</li>
|
||||
<li>Four</li>
|
||||
</ul>
|
||||
|
||||
<p><textarea class="code" style="min-height: 130px" onclick="select();">
|
||||
<ul class="my-checklist">
|
||||
<li>One</li>
|
||||
<li>Two</li>
|
||||
<li>Three</li>
|
||||
<li>Four</li>
|
||||
</ul></textarea></p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 260px;" onclick="select();">
|
||||
.my-checklist {
|
||||
list-style-type: none;
|
||||
text-indent: -16px;
|
||||
}
|
||||
.my-checklist li:before {
|
||||
padding-right: 16px;
|
||||
content: '\f418';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: text-top;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Use icons to style blockquotes:</p>
|
||||
|
||||
<blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. —<em>Lewis Carroll</em></blockquote>
|
||||
<blockquote class="my-blockquote">`Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!"</blockquote>
|
||||
|
||||
<p><textarea class="code" style="min-height: 40px;" onclick="select();"><blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. —<em>Lewis Carroll</em></blockquote></textarea></p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 300px;" onclick="select();">
|
||||
.my-blockquote {
|
||||
background: #eee;
|
||||
border-left: 32px solid #ddd;
|
||||
padding: 10px;
|
||||
}
|
||||
.my-blockquote:before {
|
||||
margin-left: -42px;
|
||||
padding-right: 10px;
|
||||
content: '\f106';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 32px/20px 'Genericons';
|
||||
vertical-align: bottom;
|
||||
} </textarea></p>
|
||||
|
||||
<p>Use icons to style buttons:</p>
|
||||
|
||||
<a class="my-button" href="javascript:void()"><i class="genericon genericon-show"></i> View</a>
|
||||
<a class="my-button" href="javascript:void()"><i class="genericon genericon-audio"></i> Listen</a>
|
||||
|
||||
<p><textarea class="code" style="min-height: 40px;" onclick="select();"><a class="my-button" href="#"><i class="genericon genericon-show"></i> View</a>
|
||||
<a class="my-button" href="#"><i class="genericon genericon-audio"></i> Listen</a></textarea></p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 300px;" onclick="select();">
|
||||
.my-button {
|
||||
font-family: Helvetica, sans-serif;
|
||||
background: #e05d22; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
|
||||
display: inline-block;
|
||||
padding: 10px 16px 6px 16px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
border-bottom: 3px solid #b93207;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.my-button:hover,
|
||||
.my-button:focus {
|
||||
background: #ed6a31; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.my-button:active {
|
||||
background: #d94412; /* Old browsers */
|
||||
background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
|
||||
background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
|
||||
background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
|
||||
background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
|
||||
background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
|
||||
border: none;
|
||||
border-top: 3px solid #b93207;
|
||||
padding: 6px 16px 10px 16px;
|
||||
}</textarea>/</p>
|
||||
|
||||
<h2>CSS Preprocessors</h2>
|
||||
|
||||
<p>Preprocessing extensions such as Sass (SCSS Syntax) or LESS</a> can make it easier to manage CSS for a lot of things at once using things like variables and mixins.</p>
|
||||
|
||||
<p>This example will seup the basic genericon rules and sets a color you can use for all icons using Sass:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 360px;" onclick="select();">$icon-color: "#fa8072";
|
||||
|
||||
.genericon {
|
||||
color: $icon-color;
|
||||
}
|
||||
|
||||
@mixin genericon-rules {
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.my-icon:before {
|
||||
content: '\f408';
|
||||
@include genericon-rules;
|
||||
}</textarea></p>
|
||||
|
||||
<p>Here is a similar example for LESS:</p>
|
||||
|
||||
<p><textarea class="code" style="min-height: 360px;" onclick="select();">@icon-color: "#fa8072";
|
||||
|
||||
.genericon {
|
||||
color: @icon-color;
|
||||
}
|
||||
|
||||
.genericon-rules {
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font: normal 16px/1 'Genericons';
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.my-icon:before {
|
||||
content: '\f408';
|
||||
.genericon-rules;
|
||||
}</textarea></p>
|
||||
|
||||
<h2>Fallback images for IE7 and below</h2>
|
||||
|
||||
<p>Genericons <strong>does not come with fallback icons by default</strong> -- therefore you have to create them yourself. If you are using HTML similar to this example:
|
||||
|
||||
<p><code><span class="genericon genericon-warning"></span></code></p>
|
||||
|
||||
<p>You can use the asterisk hack to serve a different icon to IE7 once you have saved the fallback icons to your project:</p>
|
||||
|
||||
<textarea class="code" style="min-height: 85px;" onclick="select();">.genericon-warning {
|
||||
*background: url(fallback-icon.png) no-repeat center center;
|
||||
*text-indent: 100%;
|
||||
}</textarea>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1143,8 +1143,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 );
|
||||
@@ -1258,7 +1260,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 ) ) )
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -196,6 +196,24 @@ final class WP_Customize_Manager {
|
||||
|
||||
show_admin_bar( false );
|
||||
|
||||
/*
|
||||
* Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer
|
||||
* application will inject the customize_preview_nonce query parameter into all Ajax requests.
|
||||
* For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out
|
||||
* a user when a valid nonce isn't present.
|
||||
*/
|
||||
$has_post_data_nonce = (
|
||||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false )
|
||||
||
|
||||
check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false )
|
||||
||
|
||||
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false )
|
||||
);
|
||||
if ( ! $has_post_data_nonce ) {
|
||||
unset( $_POST['customized'] );
|
||||
unset( $_REQUEST['customized'] );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'customize' ) ) {
|
||||
$this->wp_die( -1 );
|
||||
}
|
||||
|
||||
@@ -1124,7 +1124,7 @@ final class WP_Customize_Widgets {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( $this->get_instance_hash_key( $decoded ) !== $value['instance_hash_key'] ) {
|
||||
if ( ! hash_equals( $this->get_instance_hash_key( $decoded ), $value['instance_hash_key'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -312,7 +312,14 @@ class WP_Embed {
|
||||
* @return string Potentially modified $content.
|
||||
*/
|
||||
public 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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -217,7 +217,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;
|
||||
@@ -264,7 +264,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;
|
||||
@@ -276,11 +276,11 @@ final class WP_Theme implements ArrayAccess {
|
||||
// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
|
||||
if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
|
||||
$_child->parent = null;
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
|
||||
$_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
|
||||
// The two themes actually reference each other with the Template header.
|
||||
if ( $_child->stylesheet == $this->template ) {
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
}
|
||||
return;
|
||||
@@ -658,8 +658,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 );
|
||||
|
||||
@@ -332,6 +332,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 )
|
||||
@@ -1150,6 +1155,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.
|
||||
*
|
||||
@@ -1160,10 +1215,31 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
* @param array|IXR_Error $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 )
|
||||
@@ -1242,20 +1318,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1355,9 +1420,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'] ) ) {
|
||||
@@ -4580,10 +4642,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']) )
|
||||
@@ -4873,8 +4937,8 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
|
||||
|
||||
if ( ('publish' == $post_status) ) {
|
||||
if ( ( 'page' == $post_type ) && ! current_user_can( 'publish_pages' ) ) {
|
||||
if ( 'publish' == $post_status || 'private' == $post_status ) {
|
||||
if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) );
|
||||
} elseif ( ! current_user_can( 'publish_posts' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
|
||||
@@ -4918,10 +4982,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
|
||||
*/
|
||||
public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', '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] ) )
|
||||
|
||||
@@ -2252,6 +2252,9 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
*/
|
||||
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
|
||||
|
||||
// Ensure that the filtered args contain all required default values.
|
||||
$args = array_merge( $defaults, $args );
|
||||
|
||||
if ( comments_open( $post_id ) ) : ?>
|
||||
<?php
|
||||
/**
|
||||
|
||||
@@ -2118,17 +2118,7 @@ function wp_insert_comment( $commentdata ) {
|
||||
|
||||
$compacted = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_karma', 'comment_approved', 'comment_agent', 'comment_type', 'comment_parent', 'user_id' );
|
||||
if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) {
|
||||
$fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' );
|
||||
|
||||
foreach( $fields as $field ) {
|
||||
if ( isset( $compacted[ $field ] ) ) {
|
||||
$compacted[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->comments, $field, $compacted[ $field ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $wpdb->insert( $wpdb->comments, $compacted ) ) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$id = (int) $wpdb->insert_id;
|
||||
@@ -2252,6 +2242,8 @@ function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment)
|
||||
* @return int|bool The ID of the comment on success, false on failure.
|
||||
*/
|
||||
function wp_new_comment( $commentdata ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( isset( $commentdata['user_ID'] ) ) {
|
||||
$commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
|
||||
}
|
||||
@@ -2295,7 +2287,22 @@ function wp_new_comment( $commentdata ) {
|
||||
|
||||
$comment_ID = wp_insert_comment($commentdata);
|
||||
if ( ! $comment_ID ) {
|
||||
return false;
|
||||
$fields = array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content' );
|
||||
|
||||
foreach( $fields as $field ) {
|
||||
if ( isset( $commentdata[ $field ] ) ) {
|
||||
$commentdata[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->comments, $field, $commentdata[ $field ] );
|
||||
}
|
||||
}
|
||||
|
||||
$commentdata = wp_filter_comment( $commentdata );
|
||||
|
||||
$commentdata['comment_approved'] = wp_allow_comment( $commentdata );
|
||||
|
||||
$comment_ID = wp_insert_comment( $commentdata );
|
||||
if ( ! $comment_ID ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,23 +13,85 @@ if ( !function_exists('_') ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/*
|
||||
* 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' );
|
||||
}
|
||||
|
||||
// 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' ) ) ) {
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
return is_null( $length ) ? substr( $str, $start ) : substr( $str, $start, $length );
|
||||
}
|
||||
// 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 );
|
||||
|
||||
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' ) ) :
|
||||
@@ -38,16 +100,54 @@ if ( ! function_exists( 'mb_strlen' ) ) :
|
||||
}
|
||||
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()
|
||||
$charset = get_option( 'blog_charset' );
|
||||
if ( ! in_array( $charset, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
return strlen( $str );
|
||||
}
|
||||
// Use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
return count( $match[0] );
|
||||
|
||||
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') ):
|
||||
|
||||
2
wp-includes/css/admin-bar-rtl.min.css
vendored
2
wp-includes/css/admin-bar-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-includes/css/admin-bar.min.css
vendored
2
wp-includes/css/admin-bar.min.css
vendored
File diff suppressed because one or more lines are too long
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
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
2
wp-includes/css/wp-auth-check-rtl.min.css
vendored
2
wp-includes/css/wp-auth-check-rtl.min.css
vendored
@@ -1 +1 @@
|
||||
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;right:0;left:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000010}#wp-auth-check-wrap #wp-auth-check{position:fixed;right:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 -190px 0 0;padding:30px 0 0;background-color:#f1f1f1;z-index:1000011;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}@media screen and (max-width:380px){#wp-auth-check-wrap #wp-auth-check{right:0;width:100%;margin:0}}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/spinner-2x.gif) no-repeat center center;-webkit-background-size:16px 16px;background-size:16px 16px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}#wp-auth-check-wrap #wp-auth-check-form iframe{height:98%;width:100%}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;left:8px;height:22px;width:22px;cursor:pointer}#wp-auth-check-wrap .wp-auth-check-close:before{content:'\f158';display:block!important;font:400 20px/1 dashicons;speak:none;height:22px;margin:2px 0;text-align:center;width:22px;color:#777;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}#wp-auth-check-wrap .wp-auth-check-close:hover:before{color:#0073aa}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:#82878c dotted 1px}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-check-close,#wp-auth-check-wrap.fallback .wp-auth-fallback{display:block}
|
||||
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;right:0;left:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000010}#wp-auth-check-wrap #wp-auth-check{position:fixed;right:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 -190px 0 0;padding:30px 0 0;background-color:#f1f1f1;z-index:1000011;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}@media screen and (max-width:380px){#wp-auth-check-wrap #wp-auth-check{right:0;width:100%;margin:0}}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/spinner-2x.gif) center center/16px 16px no-repeat;-webkit-background-size:16px 16px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}#wp-auth-check-wrap #wp-auth-check-form iframe{height:98%;width:100%}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;left:8px;height:22px;width:22px;cursor:pointer}#wp-auth-check-wrap .wp-auth-check-close:before{content:'\f158';display:block!important;font:400 20px/1 dashicons;speak:none;height:22px;margin:2px 0;text-align:center;width:22px;color:#777;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}#wp-auth-check-wrap .wp-auth-check-close:hover:before{color:#0073aa}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:#82878c dotted 1px}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-check-close,#wp-auth-check-wrap.fallback .wp-auth-fallback{display:block}
|
||||
2
wp-includes/css/wp-auth-check.min.css
vendored
2
wp-includes/css/wp-auth-check.min.css
vendored
@@ -1 +1 @@
|
||||
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;left:0;right:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000010}#wp-auth-check-wrap #wp-auth-check{position:fixed;left:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 0 0 -190px;padding:30px 0 0;background-color:#f1f1f1;z-index:1000011;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}@media screen and (max-width:380px){#wp-auth-check-wrap #wp-auth-check{left:0;width:100%;margin:0}}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/spinner-2x.gif) no-repeat center center;-webkit-background-size:16px 16px;background-size:16px 16px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}#wp-auth-check-wrap #wp-auth-check-form iframe{height:98%;width:100%}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;right:8px;height:22px;width:22px;cursor:pointer}#wp-auth-check-wrap .wp-auth-check-close:before{content:'\f158';display:block!important;font:400 20px/1 dashicons;speak:none;height:22px;margin:2px 0;text-align:center;width:22px;color:#777;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}#wp-auth-check-wrap .wp-auth-check-close:hover:before{color:#0073aa}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:#82878c dotted 1px}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-check-close,#wp-auth-check-wrap.fallback .wp-auth-fallback{display:block}
|
||||
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;left:0;right:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000010}#wp-auth-check-wrap #wp-auth-check{position:fixed;left:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 0 0 -190px;padding:30px 0 0;background-color:#f1f1f1;z-index:1000011;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}@media screen and (max-width:380px){#wp-auth-check-wrap #wp-auth-check{left:0;width:100%;margin:0}}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/spinner-2x.gif) center center/16px 16px no-repeat;-webkit-background-size:16px 16px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}#wp-auth-check-wrap #wp-auth-check-form iframe{height:98%;width:100%}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;right:8px;height:22px;width:22px;cursor:pointer}#wp-auth-check-wrap .wp-auth-check-close:before{content:'\f158';display:block!important;font:400 20px/1 dashicons;speak:none;height:22px;margin:2px 0;text-align:center;width:22px;color:#777;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}#wp-auth-check-wrap .wp-auth-check-close:hover:before{color:#0073aa}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:#82878c dotted 1px}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-check-close,#wp-auth-check-wrap.fallback .wp-auth-fallback{display:block}
|
||||
@@ -1410,7 +1410,7 @@ 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>
|
||||
|
||||
@@ -469,7 +469,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" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -503,7 +503,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" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,7 +419,10 @@ function wpautop($pee, $br = true) {
|
||||
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
|
||||
|
||||
// Standardize newline characters to "\n".
|
||||
$pee = str_replace(array("\r\n", "\r"), "\n", $pee);
|
||||
$pee = str_replace(array("\r\n", "\r"), "\n", $pee);
|
||||
|
||||
// Find newlines in all elements and add placeholders.
|
||||
$pee = wp_replace_in_html_tags( $pee, array( "\n" => " <!-- wpnl --> " ) );
|
||||
|
||||
// Collapse line breaks before and after <option> elements so they don't get autop'd.
|
||||
if ( strpos( $pee, '<option' ) !== false ) {
|
||||
@@ -506,9 +509,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
|
||||
*
|
||||
@@ -1105,7 +1208,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
|
||||
*
|
||||
@@ -1130,6 +1234,14 @@ function sanitize_file_name( $filename ) {
|
||||
$filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
|
||||
$filename = trim( $filename, '.-_' );
|
||||
|
||||
if ( false === strpos( $filename, '.' ) ) {
|
||||
$mime_types = wp_get_mime_types();
|
||||
$filetype = wp_check_filetype( 'test.' . $filename, $mime_types );
|
||||
if ( $filetype['ext'] === $filename ) {
|
||||
$filename = 'unnamed-file.' . $filetype['ext'];
|
||||
}
|
||||
}
|
||||
|
||||
// Split the filename into a base and extension[s]
|
||||
$parts = explode('.', $filename);
|
||||
|
||||
@@ -3327,16 +3439,19 @@ function wp_make_link_relative( $link ) {
|
||||
*/
|
||||
function sanitize_option($option, $value) {
|
||||
global $wpdb;
|
||||
$error = '';
|
||||
|
||||
switch ( $option ) {
|
||||
case 'admin_email' :
|
||||
case 'new_admin_email' :
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
$value = sanitize_email( $value );
|
||||
if ( ! is_email( $value ) ) {
|
||||
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
||||
if ( function_exists( 'add_settings_error' ) )
|
||||
add_settings_error( $option, 'invalid_admin_email', __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' ) );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = sanitize_email( $value );
|
||||
if ( ! is_email( $value ) ) {
|
||||
$error = __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3381,8 +3496,12 @@ function sanitize_option($option, $value) {
|
||||
case 'blogdescription':
|
||||
case 'blogname':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
$value = wp_kses_post( $value );
|
||||
$value = esc_html( $value );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = wp_kses_post( $value );
|
||||
$value = esc_html( $value );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'blog_charset':
|
||||
@@ -3404,8 +3523,12 @@ function sanitize_option($option, $value) {
|
||||
case 'mailserver_pass':
|
||||
case 'upload_path':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
$value = strip_tags( $value );
|
||||
$value = wp_kses_data( $value );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = strip_tags( $value );
|
||||
$value = wp_kses_data( $value );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'ping_sites':
|
||||
@@ -3421,23 +3544,27 @@ function sanitize_option($option, $value) {
|
||||
|
||||
case 'siteurl':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
if ( (bool)preg_match( '#http(s?)://(.+)#i', $value) ) {
|
||||
$value = esc_url_raw($value);
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
||||
if ( function_exists('add_settings_error') )
|
||||
add_settings_error('siteurl', 'invalid_siteurl', __('The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.'));
|
||||
if ( preg_match( '#http(s?)://(.+)#i', $value ) ) {
|
||||
$value = esc_url_raw( $value );
|
||||
} else {
|
||||
$error = __( 'The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.' );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'home':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
if ( (bool)preg_match( '#http(s?)://(.+)#i', $value) ) {
|
||||
$value = esc_url_raw($value);
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
||||
if ( function_exists('add_settings_error') )
|
||||
add_settings_error('home', 'invalid_home', __('The Site address you entered did not appear to be a valid URL. Please enter a valid URL.'));
|
||||
if ( preg_match( '#http(s?)://(.+)#i', $value ) ) {
|
||||
$value = esc_url_raw( $value );
|
||||
} else {
|
||||
$error = __( 'The Site address you entered did not appear to be a valid URL. Please enter a valid URL.' );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3453,38 +3580,45 @@ function sanitize_option($option, $value) {
|
||||
|
||||
case 'illegal_names':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
if ( ! is_array( $value ) )
|
||||
$value = explode( ' ', $value );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
if ( ! is_array( $value ) )
|
||||
$value = explode( ' ', $value );
|
||||
|
||||
$value = array_values( array_filter( array_map( 'trim', $value ) ) );
|
||||
$value = array_values( array_filter( array_map( 'trim', $value ) ) );
|
||||
|
||||
if ( ! $value )
|
||||
$value = '';
|
||||
if ( ! $value )
|
||||
$value = '';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'limited_email_domains':
|
||||
case 'banned_email_domains':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
if ( ! is_array( $value ) )
|
||||
$value = explode( "\n", $value );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
if ( ! is_array( $value ) )
|
||||
$value = explode( "\n", $value );
|
||||
|
||||
$domains = array_values( array_filter( array_map( 'trim', $value ) ) );
|
||||
$value = array();
|
||||
$domains = array_values( array_filter( array_map( 'trim', $value ) ) );
|
||||
$value = array();
|
||||
|
||||
foreach ( $domains as $domain ) {
|
||||
if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
|
||||
$value[] = $domain;
|
||||
foreach ( $domains as $domain ) {
|
||||
if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) ) {
|
||||
$value[] = $domain;
|
||||
}
|
||||
}
|
||||
if ( ! $value )
|
||||
$value = '';
|
||||
}
|
||||
if ( ! $value )
|
||||
$value = '';
|
||||
break;
|
||||
|
||||
case 'timezone_string':
|
||||
$allowed_zones = timezone_identifiers_list();
|
||||
if ( ! in_array( $value, $allowed_zones ) && ! empty( $value ) ) {
|
||||
$value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
|
||||
if ( function_exists('add_settings_error') )
|
||||
add_settings_error('timezone_string', 'invalid_timezone_string', __('The timezone you have entered is not valid. Please select a valid timezone.') );
|
||||
$error = __( 'The timezone you have entered is not valid. Please select a valid timezone.' );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3492,8 +3626,12 @@ function sanitize_option($option, $value) {
|
||||
case 'category_base':
|
||||
case 'tag_base':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
$value = esc_url_raw( $value );
|
||||
$value = str_replace( 'http://', '', $value );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = esc_url_raw( $value );
|
||||
$value = str_replace( 'http://', '', $value );
|
||||
}
|
||||
break;
|
||||
|
||||
case 'default_role' :
|
||||
@@ -3504,13 +3642,24 @@ function sanitize_option($option, $value) {
|
||||
case 'moderation_keys':
|
||||
case 'blacklist_keys':
|
||||
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
|
||||
$value = explode( "\n", $value );
|
||||
$value = array_filter( array_map( 'trim', $value ) );
|
||||
$value = array_unique( $value );
|
||||
$value = implode( "\n", $value );
|
||||
if ( is_wp_error( $value ) ) {
|
||||
$error = $value->get_error_message();
|
||||
} else {
|
||||
$value = explode( "\n", $value );
|
||||
$value = array_filter( array_map( 'trim', $value ) );
|
||||
$value = array_unique( $value );
|
||||
$value = implode( "\n", $value );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! empty( $error ) ) {
|
||||
$value = get_option( $option );
|
||||
if ( function_exists( 'add_settings_error' ) ) {
|
||||
add_settings_error( $option, "invalid_{$option}", $error );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter an option value following sanitization.
|
||||
*
|
||||
@@ -4140,8 +4289,9 @@ function print_emoji_detection_script() {
|
||||
);
|
||||
|
||||
$version = 'ver=' . $wp_version;
|
||||
$develop_src = false !== strpos( $wp_version, '-src' );
|
||||
|
||||
if ( SCRIPT_DEBUG ) {
|
||||
if ( $develop_src || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
|
||||
$settings['source'] = array(
|
||||
/** This filter is documented in wp-includes/class.wp-scripts.php */
|
||||
'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ),
|
||||
@@ -4174,7 +4324,7 @@ function print_emoji_detection_script() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
|
||||
!function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f;c.supports={simple:d("simple"),flag:d("flag")},c.supports.simple&&c.supports.flag||(f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
!function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -1496,6 +1496,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 ) ) {
|
||||
@@ -1579,18 +1584,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2072,7 +2097,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
|
||||
*
|
||||
@@ -2097,14 +2122,15 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
return compact( 'ext', 'type', 'proper_filename' );
|
||||
}
|
||||
|
||||
// We're able to validate images using GD
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) && function_exists('getimagesize') ) {
|
||||
// Validate image types.
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) ) {
|
||||
|
||||
// Attempt to figure out what type of image it actually is
|
||||
$imgstats = @getimagesize( $file );
|
||||
$real_mime = wp_get_image_mime( $file );
|
||||
|
||||
// If getimagesize() knows what kind of image it really is and if the real MIME doesn't match the claimed MIME
|
||||
if ( !empty($imgstats['mime']) && $imgstats['mime'] != $type ) {
|
||||
if ( ! $real_mime ) {
|
||||
$type = $ext = false;
|
||||
} elseif ( $real_mime != $type ) {
|
||||
/**
|
||||
* Filter the list mapping image mime types to their respective extensions.
|
||||
*
|
||||
@@ -2121,10 +2147,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 ) {
|
||||
@@ -2134,10 +2160,67 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
$wp_filetype = wp_check_filetype( $new_filename, $mimes );
|
||||
$ext = $wp_filetype['ext'];
|
||||
$type = $wp_filetype['type'];
|
||||
} else {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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.
|
||||
*
|
||||
@@ -2153,6 +2236,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.
|
||||
*
|
||||
@@ -2291,8 +2406,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.
|
||||
@@ -4845,3 +4961,25 @@ function wp_delete_file( $file ) {
|
||||
@unlink( $delete );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a file if its path is within the given directory.
|
||||
*
|
||||
* @since 4.9.7
|
||||
*
|
||||
* @param string $file Absolute path to the file to delete.
|
||||
* @param string $directory Absolute path to a directory.
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
function wp_delete_file_from_directory( $file, $directory ) {
|
||||
$real_file = realpath( wp_normalize_path( $file ) );
|
||||
$real_directory = realpath( wp_normalize_path( $directory ) );
|
||||
|
||||
if ( false === $real_file || false === $real_directory || strpos( wp_normalize_path( $real_file ), trailingslashit( wp_normalize_path( $real_directory ) ) ) !== 0 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
wp_delete_file( $file );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2372,6 +2372,24 @@ function wp_no_robots() {
|
||||
echo "<meta name='robots' content='noindex,follow' />\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a noindex,noarchive meta tag and referrer origin-when-cross-origin meta tag.
|
||||
*
|
||||
* Outputs a noindex,noarchive meta tag that tells web robots not to index or cache the page content.
|
||||
* Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full
|
||||
* url as a referrer to other sites when cross-origin assets are loaded.
|
||||
*
|
||||
* Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_sensitive_page_meta' );
|
||||
*
|
||||
* @since 5.0.0
|
||||
*/
|
||||
function wp_sensitive_page_meta() {
|
||||
?>
|
||||
<meta name='robots' content='noindex,noarchive' />
|
||||
<meta name='referrer' content='strict-origin-when-cross-origin' />
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user should have a WYSIWIG editor.
|
||||
*
|
||||
@@ -2522,12 +2540,14 @@ function language_attributes($doctype = 'html') {
|
||||
if ( function_exists( 'is_rtl' ) && is_rtl() )
|
||||
$attributes[] = 'dir="rtl"';
|
||||
|
||||
if ( $lang = get_bloginfo('language') ) {
|
||||
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
|
||||
$attributes[] = "lang=\"$lang\"";
|
||||
if ( $lang = get_bloginfo( 'language' ) ) {
|
||||
if ( get_option( 'html_type' ) == 'text/html' || $doctype == 'html' ) {
|
||||
$attributes[] = 'lang="' . esc_attr( $lang ) . '"';
|
||||
}
|
||||
|
||||
if ( get_option('html_type') != 'text/html' || $doctype == 'xhtml' )
|
||||
$attributes[] = "xml:lang=\"$lang\"";
|
||||
if ( get_option( 'html_type' ) != 'text/html' || $doctype == 'xhtml' ) {
|
||||
$attributes[] = 'xml:lang="' . esc_attr( $lang ) . '"';
|
||||
}
|
||||
}
|
||||
|
||||
$output = implode(' ', $attributes);
|
||||
@@ -3028,25 +3048,25 @@ function get_the_generator( $type = '' ) {
|
||||
|
||||
switch ( $type ) {
|
||||
case 'html':
|
||||
$gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '">';
|
||||
$gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '">';
|
||||
break;
|
||||
case 'xhtml':
|
||||
$gen = '<meta name="generator" content="WordPress ' . get_bloginfo( 'version' ) . '" />';
|
||||
$gen = '<meta name="generator" content="WordPress ' . esc_attr( get_bloginfo( 'version' ) ) . '" />';
|
||||
break;
|
||||
case 'atom':
|
||||
$gen = '<generator uri="http://wordpress.org/" version="' . get_bloginfo_rss( 'version' ) . '">WordPress</generator>';
|
||||
$gen = '<generator uri="https://wordpress.org/" version="' . esc_attr( get_bloginfo_rss( 'version' ) ) . '">WordPress</generator>';
|
||||
break;
|
||||
case 'rss2':
|
||||
$gen = '<generator>http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '</generator>';
|
||||
$gen = '<generator>' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '</generator>';
|
||||
break;
|
||||
case 'rdf':
|
||||
$gen = '<admin:generatorAgent rdf:resource="http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '" />';
|
||||
$gen = '<admin:generatorAgent rdf:resource="' . esc_url_raw( 'https://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) ) . '" />';
|
||||
break;
|
||||
case 'comment':
|
||||
$gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
|
||||
$gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo( 'version' ) ) . '" -->';
|
||||
break;
|
||||
case 'export':
|
||||
$gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
|
||||
$gen = '<!-- generator="WordPress/' . esc_attr( get_bloginfo_rss( 'version' ) ) . '" created="' . date( 'Y-m-d H:i' ) . '" -->';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -466,16 +466,17 @@ function wp_http_validate_url( $url ) {
|
||||
|
||||
if ( ! $same_host ) {
|
||||
$host = trim( $parsed_url['host'], '.' );
|
||||
if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) {
|
||||
if ( preg_match( '#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host ) ) {
|
||||
$ip = $host;
|
||||
} else {
|
||||
$ip = gethostbyname( $host );
|
||||
if ( $ip === $host ) // Error condition for gethostbyname()
|
||||
$ip = false;
|
||||
if ( $ip === $host ) { // Error condition for gethostbyname()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ( $ip ) {
|
||||
$parts = array_map( 'intval', explode( '.', $ip ) );
|
||||
if ( 127 === $parts[0] || 10 === $parts[0]
|
||||
if ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0]
|
||||
|| ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
|
||||
|| ( 192 === $parts[0] && 168 === $parts[1] )
|
||||
) {
|
||||
|
||||
2
wp-includes/js/jquery/ui/datepicker.min.js
vendored
2
wp-includes/js/jquery/ui/datepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -93,8 +93,7 @@ window.wp = window.wp || {};
|
||||
setMarkers: function( content ) {
|
||||
var pieces = [ { content: content } ],
|
||||
self = this,
|
||||
instance,
|
||||
current;
|
||||
instance, current;
|
||||
|
||||
_.each( views, function( view, type ) {
|
||||
current = pieces.slice();
|
||||
@@ -102,7 +101,7 @@ window.wp = window.wp || {};
|
||||
|
||||
_.each( current, function( piece ) {
|
||||
var remaining = piece.content,
|
||||
result;
|
||||
result, text;
|
||||
|
||||
// Ignore processed pieces, but retain their location.
|
||||
if ( piece.processed ) {
|
||||
@@ -119,10 +118,11 @@ window.wp = window.wp || {};
|
||||
}
|
||||
|
||||
instance = self.createInstance( type, result.content, result.options );
|
||||
text = instance.loader ? '.' : instance.text;
|
||||
|
||||
// Add the processed piece for the match.
|
||||
pieces.push( {
|
||||
content: '<p data-wpview-marker="' + instance.encodedText + '">' + instance.text + '</p>',
|
||||
content: '<p data-wpview-marker="' + instance.encodedText + '">' + text + '</p>',
|
||||
processed: true
|
||||
} );
|
||||
|
||||
@@ -138,7 +138,8 @@ window.wp = window.wp || {};
|
||||
} );
|
||||
} );
|
||||
|
||||
return _.pluck( pieces, 'content' ).join( '' );
|
||||
content = _.pluck( pieces, 'content' ).join( '' );
|
||||
return content.replace( /<p>\s*<p data-wpview-marker=/g, '<p data-wpview-marker=' ).replace( /<\/p>\s*<\/p>/g, '</p>' );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -155,14 +156,14 @@ window.wp = window.wp || {};
|
||||
encodedText,
|
||||
instance;
|
||||
|
||||
text = tinymce.DOM.decode( text ),
|
||||
encodedText = encodeURIComponent( text ),
|
||||
instance = this.getInstance( encodedText );
|
||||
instance = this.getInstance( text );
|
||||
|
||||
if ( instance ) {
|
||||
return instance;
|
||||
}
|
||||
|
||||
encodedText = encodeURIComponent( text );
|
||||
|
||||
options = _.extend( options || {}, {
|
||||
text: text,
|
||||
encodedText: encodedText
|
||||
@@ -416,7 +417,7 @@ window.wp = window.wp || {};
|
||||
*/
|
||||
replaceMarkers: function() {
|
||||
this.getMarkers( function( editor, node ) {
|
||||
if ( $( node ).text() !== this.text ) {
|
||||
if ( ! this.loader && $( node ).text() !== tinymce.DOM.decode( this.text ) ) {
|
||||
editor.dom.setAttrib( node, 'data-wpview-marker', null );
|
||||
return;
|
||||
}
|
||||
@@ -485,6 +486,14 @@ window.wp = window.wp || {};
|
||||
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver,
|
||||
self = this;
|
||||
|
||||
if ( body.indexOf( '[' ) !== -1 && body.indexOf( ']' ) !== -1 ) {
|
||||
var shortcodesRegExp = new RegExp( '\\[\\/?(?:' + window.mceViewL10n.shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' );
|
||||
// Escape tags inside shortcode previews.
|
||||
body = body.replace( shortcodesRegExp, function( match ) {
|
||||
return match.replace( /</g, '<' ).replace( />/g, '>' );
|
||||
} );
|
||||
}
|
||||
|
||||
this.getNodes( function( editor, node, contentNode ) {
|
||||
var dom = editor.dom,
|
||||
styles = '',
|
||||
|
||||
2
wp-includes/js/mce-view.min.js
vendored
2
wp-includes/js/mce-view.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,4 +1,72 @@
|
||||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
/*globals wp, _ */
|
||||
|
||||
var media = wp.media,
|
||||
@@ -207,87 +275,21 @@ wp.media.video = {
|
||||
}
|
||||
};
|
||||
|
||||
media.model.PostMedia = require( './models/post-media.js' );
|
||||
media.controller.AudioDetails = require( './controllers/audio-details.js' );
|
||||
media.controller.VideoDetails = require( './controllers/video-details.js' );
|
||||
media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' );
|
||||
media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' );
|
||||
media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' );
|
||||
media.view.MediaDetails = require( './views/media-details.js' );
|
||||
media.view.AudioDetails = require( './views/audio-details.js' );
|
||||
media.view.VideoDetails = require( './views/video-details.js' );
|
||||
media.model.PostMedia = __webpack_require__( 1 );
|
||||
media.controller.AudioDetails = __webpack_require__( 2 );
|
||||
media.controller.VideoDetails = __webpack_require__( 3 );
|
||||
media.view.MediaFrame.MediaDetails = __webpack_require__( 4 );
|
||||
media.view.MediaFrame.AudioDetails = __webpack_require__( 5 );
|
||||
media.view.MediaFrame.VideoDetails = __webpack_require__( 6 );
|
||||
media.view.MediaDetails = __webpack_require__( 7 );
|
||||
media.view.AudioDetails = __webpack_require__( 8 );
|
||||
media.view.VideoDetails = __webpack_require__( 9 );
|
||||
|
||||
},{"./controllers/audio-details.js":2,"./controllers/video-details.js":3,"./models/post-media.js":4,"./views/audio-details.js":5,"./views/frame/audio-details.js":6,"./views/frame/media-details.js":7,"./views/frame/video-details.js":8,"./views/media-details.js":9,"./views/video-details.js":10}],2:[function(require,module,exports){
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.controller.AudioDetails
|
||||
*
|
||||
* The controller for the Audio Details state
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.controller.State
|
||||
* @augments Backbone.Model
|
||||
*/
|
||||
var State = wp.media.controller.State,
|
||||
l10n = wp.media.view.l10n,
|
||||
AudioDetails;
|
||||
/***/ }),
|
||||
/* 1 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
AudioDetails = State.extend({
|
||||
defaults: {
|
||||
id: 'audio-details',
|
||||
toolbar: 'audio-details',
|
||||
title: l10n.audioDetailsTitle,
|
||||
content: 'audio-details',
|
||||
menu: 'audio-details',
|
||||
router: false,
|
||||
priority: 60
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
this.media = options.media;
|
||||
State.prototype.initialize.apply( this, arguments );
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AudioDetails;
|
||||
|
||||
},{}],3:[function(require,module,exports){
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.controller.VideoDetails
|
||||
*
|
||||
* The controller for the Video Details state
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.controller.State
|
||||
* @augments Backbone.Model
|
||||
*/
|
||||
var State = wp.media.controller.State,
|
||||
l10n = wp.media.view.l10n,
|
||||
VideoDetails;
|
||||
|
||||
VideoDetails = State.extend({
|
||||
defaults: {
|
||||
id: 'video-details',
|
||||
toolbar: 'video-details',
|
||||
title: l10n.videoDetailsTitle,
|
||||
content: 'video-details',
|
||||
menu: 'video-details',
|
||||
router: false,
|
||||
priority: 60
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
this.media = options.media;
|
||||
State.prototype.initialize.apply( this, arguments );
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = VideoDetails;
|
||||
|
||||
},{}],4:[function(require,module,exports){
|
||||
/*globals wp, Backbone, _ */
|
||||
|
||||
/**
|
||||
@@ -331,125 +333,89 @@ var PostMedia = Backbone.Model.extend({
|
||||
|
||||
module.exports = PostMedia;
|
||||
|
||||
},{}],5:[function(require,module,exports){
|
||||
|
||||
/***/ }),
|
||||
/* 2 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.AudioDetails
|
||||
* wp.media.controller.AudioDetails
|
||||
*
|
||||
* The controller for the Audio Details state
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.view.MediaDetails
|
||||
* @augments wp.media.view.Settings.AttachmentDisplay
|
||||
* @augments wp.media.view.Settings
|
||||
* @augments wp.media.View
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
* @augments wp.media.controller.State
|
||||
* @augments Backbone.Model
|
||||
*/
|
||||
var MediaDetails = wp.media.view.MediaDetails,
|
||||
AudioDetails;
|
||||
|
||||
AudioDetails = MediaDetails.extend({
|
||||
className: 'audio-details',
|
||||
template: wp.template('audio-details'),
|
||||
|
||||
setMedia: function() {
|
||||
var audio = this.$('.wp-audio-shortcode');
|
||||
|
||||
if ( audio.find( 'source' ).length ) {
|
||||
if ( audio.is(':hidden') ) {
|
||||
audio.show();
|
||||
}
|
||||
this.media = MediaDetails.prepareSrc( audio.get(0) );
|
||||
} else {
|
||||
audio.hide();
|
||||
this.media = false;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AudioDetails;
|
||||
|
||||
},{}],6:[function(require,module,exports){
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.MediaFrame.AudioDetails
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.view.MediaFrame.MediaDetails
|
||||
* @augments wp.media.view.MediaFrame.Select
|
||||
* @augments wp.media.view.MediaFrame
|
||||
* @augments wp.media.view.Frame
|
||||
* @augments wp.media.View
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
||||
MediaLibrary = wp.media.controller.MediaLibrary,
|
||||
|
||||
var State = wp.media.controller.State,
|
||||
l10n = wp.media.view.l10n,
|
||||
AudioDetails;
|
||||
|
||||
AudioDetails = MediaDetails.extend({
|
||||
AudioDetails = State.extend({
|
||||
defaults: {
|
||||
id: 'audio',
|
||||
url: '',
|
||||
menu: 'audio-details',
|
||||
content: 'audio-details',
|
||||
id: 'audio-details',
|
||||
toolbar: 'audio-details',
|
||||
type: 'link',
|
||||
title: l10n.audioDetailsTitle,
|
||||
priority: 120
|
||||
title: l10n.audioDetailsTitle,
|
||||
content: 'audio-details',
|
||||
menu: 'audio-details',
|
||||
router: false,
|
||||
priority: 60
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
options.DetailsView = wp.media.view.AudioDetails;
|
||||
options.cancelText = l10n.audioDetailsCancel;
|
||||
options.addText = l10n.audioAddSourceTitle;
|
||||
|
||||
MediaDetails.prototype.initialize.call( this, options );
|
||||
},
|
||||
|
||||
bindHandlers: function() {
|
||||
MediaDetails.prototype.bindHandlers.apply( this, arguments );
|
||||
|
||||
this.on( 'toolbar:render:replace-audio', this.renderReplaceToolbar, this );
|
||||
this.on( 'toolbar:render:add-audio-source', this.renderAddSourceToolbar, this );
|
||||
},
|
||||
|
||||
createStates: function() {
|
||||
this.states.add([
|
||||
new wp.media.controller.AudioDetails( {
|
||||
media: this.media
|
||||
} ),
|
||||
|
||||
new MediaLibrary( {
|
||||
type: 'audio',
|
||||
id: 'replace-audio',
|
||||
title: l10n.audioReplaceTitle,
|
||||
toolbar: 'replace-audio',
|
||||
media: this.media,
|
||||
menu: 'audio-details'
|
||||
} ),
|
||||
|
||||
new MediaLibrary( {
|
||||
type: 'audio',
|
||||
id: 'add-audio-source',
|
||||
title: l10n.audioAddSourceTitle,
|
||||
toolbar: 'add-audio-source',
|
||||
media: this.media,
|
||||
menu: false
|
||||
} )
|
||||
]);
|
||||
this.media = options.media;
|
||||
State.prototype.initialize.apply( this, arguments );
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AudioDetails;
|
||||
|
||||
},{}],7:[function(require,module,exports){
|
||||
|
||||
/***/ }),
|
||||
/* 3 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.controller.VideoDetails
|
||||
*
|
||||
* The controller for the Video Details state
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.controller.State
|
||||
* @augments Backbone.Model
|
||||
*/
|
||||
var State = wp.media.controller.State,
|
||||
l10n = wp.media.view.l10n,
|
||||
VideoDetails;
|
||||
|
||||
VideoDetails = State.extend({
|
||||
defaults: {
|
||||
id: 'video-details',
|
||||
toolbar: 'video-details',
|
||||
title: l10n.videoDetailsTitle,
|
||||
content: 'video-details',
|
||||
menu: 'video-details',
|
||||
router: false,
|
||||
priority: 60
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
this.media = options.media;
|
||||
State.prototype.initialize.apply( this, arguments );
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = VideoDetails;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 4 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
@@ -581,7 +547,93 @@ MediaDetails = Select.extend({
|
||||
|
||||
module.exports = MediaDetails;
|
||||
|
||||
},{}],8:[function(require,module,exports){
|
||||
|
||||
/***/ }),
|
||||
/* 5 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.MediaFrame.AudioDetails
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.view.MediaFrame.MediaDetails
|
||||
* @augments wp.media.view.MediaFrame.Select
|
||||
* @augments wp.media.view.MediaFrame
|
||||
* @augments wp.media.view.Frame
|
||||
* @augments wp.media.View
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
* @mixes wp.media.controller.StateMachine
|
||||
*/
|
||||
var MediaDetails = wp.media.view.MediaFrame.MediaDetails,
|
||||
MediaLibrary = wp.media.controller.MediaLibrary,
|
||||
|
||||
l10n = wp.media.view.l10n,
|
||||
AudioDetails;
|
||||
|
||||
AudioDetails = MediaDetails.extend({
|
||||
defaults: {
|
||||
id: 'audio',
|
||||
url: '',
|
||||
menu: 'audio-details',
|
||||
content: 'audio-details',
|
||||
toolbar: 'audio-details',
|
||||
type: 'link',
|
||||
title: l10n.audioDetailsTitle,
|
||||
priority: 120
|
||||
},
|
||||
|
||||
initialize: function( options ) {
|
||||
options.DetailsView = wp.media.view.AudioDetails;
|
||||
options.cancelText = l10n.audioDetailsCancel;
|
||||
options.addText = l10n.audioAddSourceTitle;
|
||||
|
||||
MediaDetails.prototype.initialize.call( this, options );
|
||||
},
|
||||
|
||||
bindHandlers: function() {
|
||||
MediaDetails.prototype.bindHandlers.apply( this, arguments );
|
||||
|
||||
this.on( 'toolbar:render:replace-audio', this.renderReplaceToolbar, this );
|
||||
this.on( 'toolbar:render:add-audio-source', this.renderAddSourceToolbar, this );
|
||||
},
|
||||
|
||||
createStates: function() {
|
||||
this.states.add([
|
||||
new wp.media.controller.AudioDetails( {
|
||||
media: this.media
|
||||
} ),
|
||||
|
||||
new MediaLibrary( {
|
||||
type: 'audio',
|
||||
id: 'replace-audio',
|
||||
title: l10n.audioReplaceTitle,
|
||||
toolbar: 'replace-audio',
|
||||
media: this.media,
|
||||
menu: 'audio-details'
|
||||
} ),
|
||||
|
||||
new MediaLibrary( {
|
||||
type: 'audio',
|
||||
id: 'add-audio-source',
|
||||
title: l10n.audioAddSourceTitle,
|
||||
toolbar: 'add-audio-source',
|
||||
media: this.media,
|
||||
menu: false
|
||||
} )
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AudioDetails;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 6 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp, _ */
|
||||
|
||||
/**
|
||||
@@ -704,7 +756,7 @@ VideoDetails = MediaDetails.extend({
|
||||
|
||||
if ( -1 === content.indexOf( attachment.get( 'url' ) ) ) {
|
||||
content += [
|
||||
'<track srclang="en" label="English"kind="subtitles" src="',
|
||||
'<track srclang="en" label="English" kind="subtitles" src="',
|
||||
attachment.get( 'url' ),
|
||||
'" />'
|
||||
].join('');
|
||||
@@ -718,7 +770,11 @@ VideoDetails = MediaDetails.extend({
|
||||
|
||||
module.exports = VideoDetails;
|
||||
|
||||
},{}],9:[function(require,module,exports){
|
||||
|
||||
/***/ }),
|
||||
/* 7 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*global wp, jQuery, _, MediaElementPlayer */
|
||||
|
||||
/**
|
||||
@@ -886,7 +942,55 @@ MediaDetails = AttachmentDisplay.extend({
|
||||
|
||||
module.exports = MediaDetails;
|
||||
|
||||
},{}],10:[function(require,module,exports){
|
||||
|
||||
/***/ }),
|
||||
/* 8 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
* wp.media.view.AudioDetails
|
||||
*
|
||||
* @class
|
||||
* @augments wp.media.view.MediaDetails
|
||||
* @augments wp.media.view.Settings.AttachmentDisplay
|
||||
* @augments wp.media.view.Settings
|
||||
* @augments wp.media.View
|
||||
* @augments wp.Backbone.View
|
||||
* @augments Backbone.View
|
||||
*/
|
||||
var MediaDetails = wp.media.view.MediaDetails,
|
||||
AudioDetails;
|
||||
|
||||
AudioDetails = MediaDetails.extend({
|
||||
className: 'audio-details',
|
||||
template: wp.template('audio-details'),
|
||||
|
||||
setMedia: function() {
|
||||
var audio = this.$('.wp-audio-shortcode');
|
||||
|
||||
if ( audio.find( 'source' ).length ) {
|
||||
if ( audio.is(':hidden') ) {
|
||||
audio.show();
|
||||
}
|
||||
this.media = MediaDetails.prepareSrc( audio.get(0) );
|
||||
} else {
|
||||
audio.hide();
|
||||
this.media = false;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AudioDetails;
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* 9 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
/*globals wp */
|
||||
|
||||
/**
|
||||
@@ -931,4 +1035,6 @@ VideoDetails = MediaDetails.extend({
|
||||
|
||||
module.exports = VideoDetails;
|
||||
|
||||
},{}]},{},[1]);
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
2
wp-includes/js/media-audiovideo.min.js
vendored
2
wp-includes/js/media-audiovideo.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user