Compare commits
125 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf8dc0fe50 | ||
|
|
7f38e9a815 | ||
|
|
d1db26f726 | ||
|
|
7da57d4ef3 | ||
|
|
594a9e14e7 | ||
|
|
8576838329 | ||
|
|
ba70965edc | ||
|
|
0ff6ca33c7 | ||
|
|
ea26079cde | ||
|
|
53226bc6f2 | ||
|
|
dfea282b1d | ||
|
|
97a834aaab | ||
|
|
5014bb866c | ||
|
|
96ad697c96 | ||
|
|
4686a8e4e7 | ||
|
|
5ef1e3048b | ||
|
|
831baf7b04 | ||
|
|
fdc6949e64 | ||
|
|
008ebcfae7 | ||
|
|
0c61562bf5 | ||
|
|
b7606aaa3c | ||
|
|
3edf686b37 | ||
|
|
fc3a293811 | ||
|
|
31ebb3f94b | ||
|
|
996d8547e3 | ||
|
|
7a06b64959 | ||
|
|
8417706532 | ||
|
|
811541dfe6 | ||
|
|
792858da14 | ||
|
|
bb869f458b | ||
|
|
9641009151 | ||
|
|
aff3c77aad | ||
|
|
c5eb54f359 | ||
|
|
98037bb876 | ||
|
|
d4608a9fe5 | ||
|
|
464ce8a75f | ||
|
|
8f57ec6bbf | ||
|
|
96890b155a | ||
|
|
fbb0252a46 | ||
|
|
16156dcff9 | ||
|
|
cfb6ef101b | ||
|
|
1c86df8bbf | ||
|
|
b2c747a38e | ||
|
|
10be03b2d7 | ||
|
|
ad0a3701d4 | ||
|
|
67a0654bcb | ||
|
|
fa12b4a44c | ||
|
|
4e39f0ba11 | ||
|
|
b435ecd2f8 | ||
|
|
6af36f8915 | ||
|
|
f56dd747c8 | ||
|
|
2a42fc2e73 | ||
|
|
7bd9e93fef | ||
|
|
6c6ea88f7d | ||
|
|
dc27207e1f | ||
|
|
27c4e15959 | ||
|
|
ff692384e0 | ||
|
|
e4e09f8491 | ||
|
|
8b1471168e | ||
|
|
932a7677e8 | ||
|
|
d7aecf3611 | ||
|
|
a067868b73 | ||
|
|
6f300d7d12 | ||
|
|
940eb60ad7 | ||
|
|
ca3e6728d1 | ||
|
|
5594f44f40 | ||
|
|
bb7e7f5a0b | ||
|
|
e8ea407eb6 | ||
|
|
c0357c466d | ||
|
|
3fa0efa6e3 | ||
|
|
05c849b3ee | ||
|
|
3224f9b9c2 | ||
|
|
14f8d5a6e5 | ||
|
|
f62b6a2c8b | ||
|
|
f00aac7c5c | ||
|
|
824ca5b030 | ||
|
|
9173953c3e | ||
|
|
ac2d674473 | ||
|
|
b86cd8511b | ||
|
|
ad39a33a22 | ||
|
|
c4b546f41f | ||
|
|
7d2bc0ab0d | ||
|
|
ef84a2bea6 | ||
|
|
c462d023dd | ||
|
|
01793d489b | ||
|
|
38b8a2fbf9 | ||
|
|
f87cbbf9c9 | ||
|
|
3c530e46cb | ||
|
|
e1f345903f | ||
|
|
d6656c58e0 | ||
|
|
dfb0e1aaa8 | ||
|
|
c51b6347e4 | ||
|
|
8b65448e85 | ||
|
|
900f223ed5 | ||
|
|
73a09188b8 | ||
|
|
c85dc97274 | ||
|
|
f2512c50eb | ||
|
|
524068c83b | ||
|
|
daddadfb70 | ||
|
|
9753a18ddf | ||
|
|
17457983b4 | ||
|
|
b4245bb9f6 | ||
|
|
8649425906 | ||
|
|
21796de8ba | ||
|
|
6e4bb1ab4a | ||
|
|
0579fdbc6a | ||
|
|
6b49e2278b | ||
|
|
f2f0f62a3e | ||
|
|
44c39135ab | ||
|
|
75c9032983 | ||
|
|
b5e12ae249 | ||
|
|
f690e6fe0f | ||
|
|
2766c5f44d | ||
|
|
7aa8fbd1dd | ||
|
|
fba1c51e98 | ||
|
|
fe6fdac4c1 | ||
|
|
653bc12e2b | ||
|
|
df62215a18 | ||
|
|
09e4a3ca6c | ||
|
|
3b0cc6d419 | ||
|
|
07e6c72972 | ||
|
|
37d4b468ea | ||
|
|
3dd112ef79 | ||
|
|
0cecdccf75 | ||
|
|
57db9dcaa2 |
@@ -1,6 +1,6 @@
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2014 by the contributors
|
||||
Copyright 2015 by the contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<h1 id="logo">
|
||||
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
|
||||
<br /> Version 3.9
|
||||
<br /> Version 3.9.12
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
|
||||
@@ -38,10 +38,62 @@ 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', 12 ); ?></h3>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '3.9.12' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.12' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '3.9.11' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.11' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 1 ), '3.9.10' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.10' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 2 ), '3.9.9', number_format_i18n( 2 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.9' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 2 ), '3.9.8', number_format_i18n( 2 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.8' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 2 ), '3.9.7' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.7' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 3 ), '3.9.6', number_format_i18n( 3 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.6' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 1 ), '3.9.5', number_format_i18n( 1 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.5' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 8 ), '3.9.4' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.4' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 9 ), '3.9.3', number_format_i18n( 9 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.3' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.', 6 ), '3.9.2', number_format_i18n( 6 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.2' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 34 ), '3.9.1', number_format_i18n( 34 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_3.9.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<div class="about-overview">
|
||||
<?php
|
||||
if ( ( $locale = get_locale() ) && 'en_' === substr( $locale, 0, 3 ) ) : ?>
|
||||
if ( ! is_ssl() && ( $locale = get_locale() ) && 'en_' === substr( $locale, 0, 3 ) ) : ?>
|
||||
<embed src="//v0.wordpress.com/player.swf?v=1.03" type="application/x-shockwave-flash" width="640" height="360" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=sAiXhCfV&isDynamicSeeking=true" title=""></embed>
|
||||
<?php else : ?>
|
||||
<img class="about-overview-img" src="//s.w.org/images/core/3.9/overview.png?0" />
|
||||
|
||||
@@ -82,7 +82,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating to WordPress %s, the most beautiful WordPress yet.' ), $display_version ); ?></div>
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s has lots of refinements we think you’ll love.' ), $display_version ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ ul#adminmenu > li.current > a.current:after {
|
||||
}
|
||||
|
||||
#adminmenu .awaiting-mod,
|
||||
#adminmenu span.update-plugins,
|
||||
#adminmenu .update-plugins,
|
||||
#sidemenu li a span.update-plugins {
|
||||
display: inline-block;
|
||||
background-color: #d54e21;
|
||||
|
||||
@@ -500,7 +500,7 @@ ul#adminmenu > li.current > a.current:after {
|
||||
}
|
||||
|
||||
#adminmenu .awaiting-mod,
|
||||
#adminmenu span.update-plugins,
|
||||
#adminmenu .update-plugins,
|
||||
#sidemenu li a span.update-plugins {
|
||||
display: inline-block;
|
||||
background-color: #d54e21;
|
||||
|
||||
@@ -355,7 +355,7 @@ td.plugin-title p {
|
||||
#content-resize-handle {
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll left bottom;
|
||||
width: 12px;
|
||||
cursor: n-resize;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.rtl #content-resize-handle {
|
||||
|
||||
@@ -355,7 +355,7 @@ td.plugin-title p {
|
||||
#content-resize-handle {
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
|
||||
width: 12px;
|
||||
cursor: n-resize;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.rtl #content-resize-handle {
|
||||
|
||||
@@ -75,24 +75,6 @@ input[type=radio] {
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked:before,
|
||||
input[type=radio]:checked:before {
|
||||
float: right;
|
||||
@@ -268,6 +250,24 @@ input[readonly] {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
2.0 - Forms
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -75,24 +75,6 @@ input[type=radio] {
|
||||
line-height: 10px;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked:before,
|
||||
input[type=radio]:checked:before {
|
||||
float: left;
|
||||
@@ -268,6 +250,24 @@ input[readonly] {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
input:disabled,
|
||||
input.disabled,
|
||||
textarea:disabled,
|
||||
textarea.disabled {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
|
||||
border-color: rgba(222, 222, 222, .75);
|
||||
background: rgba(255, 255, 255, .5);
|
||||
color: rgba(51, 51, 51, .5);
|
||||
}
|
||||
|
||||
input[type=checkbox]:disabled,
|
||||
input[type=radio]:disabled,
|
||||
input[type=checkbox]:disabled:checked:before,
|
||||
input[type=radio]:disabled:checked:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
2.0 - Forms
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
2
wp-admin/css/login-rtl.min.css
vendored
2
wp-admin/css/login-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login.min.css
vendored
2
wp-admin/css/login.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin-rtl.min.css
vendored
2
wp-admin/css/wp-admin-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/wp-admin.min.css
vendored
2
wp-admin/css/wp-admin.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -40,7 +40,7 @@ class Custom_Image_Header {
|
||||
* @since 3.0.0
|
||||
* @access private
|
||||
*/
|
||||
var $default_headers;
|
||||
var $default_headers = array();
|
||||
|
||||
/**
|
||||
* Holds custom headers uploaded by the user.
|
||||
@@ -254,7 +254,7 @@ class Custom_Image_Header {
|
||||
if ( !isset($_wp_default_headers) )
|
||||
return;
|
||||
|
||||
if ( is_array( $this->default_headers ) ) {
|
||||
if ( ! empty( $this->default_headers ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating to WordPress %s, the most beautiful WordPress yet.' ), $display_version ); ?></div>
|
||||
<div class="about-text"><?php printf( __( 'Thank you for updating! WordPress %s has lots of refinements we think you’ll love.' ), $display_version ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
|
||||
@@ -1323,11 +1323,13 @@ function wp_ajax_inline_save() {
|
||||
if ( isset($data['post_parent']) )
|
||||
$data['parent_id'] = $data['post_parent'];
|
||||
|
||||
// status
|
||||
if ( isset($data['keep_private']) && 'private' == $data['keep_private'] )
|
||||
// Status.
|
||||
if ( isset( $data['keep_private'] ) && 'private' == $data['keep_private'] ) {
|
||||
$data['visibility'] = 'private';
|
||||
$data['post_status'] = 'private';
|
||||
else
|
||||
} else {
|
||||
$data['post_status'] = $data['_status'];
|
||||
}
|
||||
|
||||
if ( empty($data['comment_status']) )
|
||||
$data['comment_status'] = 'closed';
|
||||
@@ -2233,7 +2235,7 @@ function wp_ajax_query_themes() {
|
||||
wp_send_json_error();
|
||||
}
|
||||
|
||||
$update_php = self_admin_url( 'update.php?action=install-theme' );
|
||||
$update_php = network_admin_url( 'update.php?action=install-theme' );
|
||||
foreach ( $api->themes as &$theme ) {
|
||||
$theme->install_url = add_query_arg( array(
|
||||
'theme' => $theme->slug,
|
||||
|
||||
@@ -537,9 +537,9 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
|
||||
if ( current_user_can( 'edit_post', $post->ID ) ) {
|
||||
$post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
|
||||
$post_link .= get_the_title( $post->ID ) . '</a>';
|
||||
$post_link .= esc_html( get_the_title( $post->ID ) ) . '</a>';
|
||||
} else {
|
||||
$post_link = get_the_title( $post->ID );
|
||||
$post_link = esc_html( get_the_title( $post->ID ) );
|
||||
}
|
||||
|
||||
echo '<div class="response-links"><span class="post-com-count-wrapper">';
|
||||
|
||||
@@ -219,7 +219,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>";
|
||||
echo "<td $attributes><a href='" . esc_url( "mailto:$user->user_email" ) . "'>$user->user_email</a></td>";
|
||||
break;
|
||||
|
||||
case 'registered':
|
||||
|
||||
@@ -417,7 +417,7 @@ class WP_Users_List_Table extends WP_List_Table {
|
||||
$r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>";
|
||||
break;
|
||||
case 'email':
|
||||
$r .= "<td $attributes><a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a></td>";
|
||||
$r .= "<td $attributes><a href='" . esc_url( "mailto:$email" ) . "' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a></td>";
|
||||
break;
|
||||
case 'role':
|
||||
$r .= "<td $attributes>$role_name</td>";
|
||||
|
||||
@@ -429,6 +429,10 @@ function wp_network_dashboard_right_now() {
|
||||
function wp_dashboard_quick_press( $error_msg = false ) {
|
||||
global $post_ID;
|
||||
|
||||
if ( ! current_user_can( 'edit_posts' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */
|
||||
$last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID
|
||||
if ( $last_post_id ) {
|
||||
@@ -531,7 +535,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
|
||||
function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
|
||||
$GLOBALS['comment'] =& $comment;
|
||||
|
||||
$comment_post_title = strip_tags(get_the_title( $comment->comment_post_ID ));
|
||||
$comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
|
||||
|
||||
if ( current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
|
||||
$comment_post_url = get_edit_post_link( $comment->comment_post_ID );
|
||||
|
||||
@@ -366,6 +366,12 @@ function wp_read_image_metadata( $file ) {
|
||||
$meta[ $key ] = utf8_encode( $meta[ $key ] );
|
||||
}
|
||||
|
||||
foreach ( $meta as &$value ) {
|
||||
if ( is_string( $value ) ) {
|
||||
$value = wp_kses_post( $value );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the array of meta data read from an image's exif data.
|
||||
*
|
||||
|
||||
@@ -177,6 +177,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
* @return int Post ID.
|
||||
*/
|
||||
function edit_post( $post_data = null ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( empty($post_data) )
|
||||
$post_data = &$_POST;
|
||||
@@ -317,7 +318,19 @@ function edit_post( $post_data = null ) {
|
||||
|
||||
update_post_meta( $post_ID, '_edit_last', get_current_user_id() );
|
||||
|
||||
wp_update_post( $post_data );
|
||||
$success = wp_update_post( $post_data );
|
||||
// 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 ] );
|
||||
}
|
||||
}
|
||||
|
||||
wp_update_post( $post_data );
|
||||
}
|
||||
|
||||
// Now that we have an ID we can fix any attachment anchor hrefs
|
||||
_fix_attachment_links( $post_ID );
|
||||
@@ -1456,7 +1469,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
|
||||
}
|
||||
|
||||
|
||||
@@ -1437,7 +1437,7 @@ function _draft_or_post_title( $post = 0 ) {
|
||||
$title = get_the_title( $post );
|
||||
if ( empty( $title ) )
|
||||
$title = __( '(no title)' );
|
||||
return $title;
|
||||
return esc_html( $title );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1011,6 +1011,9 @@ function update_core($from, $to) {
|
||||
$wp_filesystem->delete($old_file, true);
|
||||
}
|
||||
|
||||
// Remove any Genericons example.html's from the filesystem
|
||||
_upgrade_422_remove_genericons();
|
||||
|
||||
// Upgrade DB with separate request
|
||||
/** This filter is documented in wp-admin/includes/update-core.php */
|
||||
apply_filters( 'update_feedback', __( 'Upgrading database…' ) );
|
||||
@@ -1146,3 +1149,68 @@ window.location = 'about.php?updated';
|
||||
exit();
|
||||
}
|
||||
add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
|
||||
|
||||
/**
|
||||
* Cleans up Genericons example files.
|
||||
*
|
||||
* @since 4.2.2
|
||||
*/
|
||||
function _upgrade_422_remove_genericons() {
|
||||
global $wp_theme_directories, $wp_filesystem;
|
||||
|
||||
// A list of the affected files using the filesystem absolute paths.
|
||||
$affected_files = array();
|
||||
|
||||
// Themes
|
||||
foreach ( $wp_theme_directories as $directory ) {
|
||||
$directory = trailingslashit( $directory );
|
||||
$affected_theme_files = _upgrade_422_find_genericons_files_in_folder( $directory );
|
||||
$affected_files = array_merge( $affected_files, $affected_theme_files );
|
||||
}
|
||||
|
||||
// Plugins
|
||||
$plugin_dir = trailingslashit( WP_PLUGIN_DIR );
|
||||
$affected_plugin_files = _upgrade_422_find_genericons_files_in_folder( $plugin_dir );
|
||||
$affected_files = array_merge( $affected_files, $affected_plugin_files );
|
||||
|
||||
foreach ( $affected_files as $file ) {
|
||||
$gen_dir = $wp_filesystem->find_folder( dirname( $file ) . '/' );
|
||||
if ( ! $gen_dir ) {
|
||||
continue;
|
||||
}
|
||||
// The path when the file is accessed via WP_Filesystem may differ in the case of FTP
|
||||
$remote_file = $gen_dir . basename( $file );
|
||||
|
||||
if ( ! $wp_filesystem->exists( $remote_file ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->delete( $remote_file, false, 'f' ) ) {
|
||||
$wp_filesystem->put_contents( $remote_file, '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively find Genericons example files in a given folder.
|
||||
*
|
||||
* @ignore
|
||||
* @since 4.2.2
|
||||
*
|
||||
* @param string $directory Directory path. Expects trailingslashed.
|
||||
* @return array
|
||||
*/
|
||||
function _upgrade_422_find_genericons_files_in_folder( $directory ) {
|
||||
|
||||
$files = array();
|
||||
if ( file_exists( "{$directory}example.html" ) && false !== strpos( file_get_contents( "{$directory}example.html" ), '<title>Genericons</title>' ) ) {
|
||||
$files[] = substr( "{$directory}example.html", strlen( $base ) );
|
||||
}
|
||||
|
||||
foreach ( glob( $directory . '*', GLOB_ONLYDIR ) as $dir ) {
|
||||
$dir = trailingslashit( $dir );
|
||||
$files = array_merge( $files, _upgrade_422_find_genericons_files_in_folder( $dir ) );
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
@@ -430,6 +430,9 @@ function upgrade_all() {
|
||||
if ( $wp_current_db_version < 26691 )
|
||||
upgrade_380();
|
||||
|
||||
if ( $wp_current_db_version < 27918 )
|
||||
upgrade_397();
|
||||
|
||||
maybe_disable_link_manager();
|
||||
|
||||
maybe_disable_automattic_widgets();
|
||||
@@ -1270,6 +1273,63 @@ function upgrade_380() {
|
||||
deactivate_plugins( array( 'mp6/mp6.php' ), true );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 3.9.6.
|
||||
*
|
||||
* @since 3.9.6
|
||||
*/
|
||||
function upgrade_396() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute changes made in WordPress 3.9.7.
|
||||
*
|
||||
* @since 3.9.7
|
||||
*/
|
||||
function upgrade_397() {
|
||||
global $wp_current_db_version, $wpdb;
|
||||
|
||||
if ( $wp_current_db_version < 27918 ) {
|
||||
$content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );
|
||||
|
||||
if ( is_wp_error( $content_length ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( false === $content_length ) {
|
||||
$content_length = array(
|
||||
'type' => 'byte',
|
||||
'length' => 65535,
|
||||
);
|
||||
} elseif ( ! is_array( $content_length ) ) {
|
||||
$length = (int) $content_length > 0 ? (int) $content_length : 65535;
|
||||
$content_length = array(
|
||||
'type' => 'byte',
|
||||
'length' => $length
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) {
|
||||
// Sites with malformed DB schemas are on their own.
|
||||
return;
|
||||
}
|
||||
|
||||
$allowed_length = intval( $content_length['length'] ) - 10;
|
||||
|
||||
$comments = $wpdb->get_results(
|
||||
"SELECT `comment_ID` FROM `{$wpdb->comments}`
|
||||
WHERE `comment_date_gmt` > '2015-04-26'
|
||||
AND LENGTH( `comment_content` ) >= {$allowed_length}
|
||||
AND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )"
|
||||
);
|
||||
|
||||
foreach ( $comments as $comment ) {
|
||||
wp_delete_comment( $comment->comment_ID, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute network level changes
|
||||
*
|
||||
|
||||
@@ -309,8 +309,8 @@
|
||||
|
||||
api.HeaderControl = api.Control.extend({
|
||||
ready: function() {
|
||||
this.btnRemove = $('.actions .remove');
|
||||
this.btnNew = $('.actions .new');
|
||||
this.btnRemove = $('#customize-control-header_image .actions .remove');
|
||||
this.btnNew = $('#customize-control-header_image .actions .new');
|
||||
|
||||
_.bindAll(this, 'openMedia', 'removeImage');
|
||||
|
||||
|
||||
2
wp-admin/js/customize-controls.min.js
vendored
2
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -451,14 +451,14 @@ var wpNavMenu;
|
||||
if ( ! isPrimaryMenuItem ) {
|
||||
thisLink = menuItem.find( '.menus-move-left' ),
|
||||
thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft );
|
||||
thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).css( 'display', 'inline' );
|
||||
thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).text( thisLinkText ).css( 'display', 'inline' );
|
||||
}
|
||||
|
||||
if ( 0 !== position ) {
|
||||
if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) {
|
||||
thisLink = menuItem.find( '.menus-move-right' ),
|
||||
thisLinkText = menus.under.replace( '%s', prevItemNameRight );
|
||||
thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).css( 'display', 'inline' );
|
||||
thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).text( thisLinkText ).css( 'display', 'inline' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ var wpNavMenu;
|
||||
title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName );
|
||||
}
|
||||
|
||||
$this.prop('title', title).html( title );
|
||||
$this.prop('title', title).text( title );
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1025,7 +1025,7 @@ jQuery(document).ready( function($) {
|
||||
|
||||
if ( mce ) {
|
||||
editor.focus();
|
||||
toolbarHeight = $( '#wp-content-editor-container .mce-toolbar-grp' ).height();
|
||||
toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
|
||||
|
||||
if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
|
||||
toolbarHeight = 30;
|
||||
|
||||
2
wp-admin/js/post.min.js
vendored
2
wp-admin/js/post.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -237,7 +237,7 @@ if ( isset( $_GET['updated'] ) ) {
|
||||
<tr>
|
||||
<th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
|
||||
<td>
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
|
||||
<input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo esc_attr( get_site_option('first_comment_author') ); ?>" />
|
||||
<p class="description">
|
||||
<?php _e( 'The author of the first comment on a new site.' ) ?>
|
||||
</p>
|
||||
|
||||
@@ -113,8 +113,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 +160,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();
|
||||
|
||||
@@ -63,7 +63,7 @@ function press_it() {
|
||||
// error handling for media_sideload
|
||||
if ( is_wp_error($upload) ) {
|
||||
wp_delete_post($post_ID);
|
||||
wp_die($upload);
|
||||
wp_die( esc_html( $upload->get_error_message() ) );
|
||||
} else {
|
||||
// Post formats
|
||||
if ( isset( $_POST['post_format'] ) ) {
|
||||
|
||||
@@ -98,7 +98,7 @@ if ( is_multisite()
|
||||
// Execute confirmed email change. See send_confirmation_on_profile_email().
|
||||
if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
|
||||
$new_email = get_option( $current_user->ID . '_new_email' );
|
||||
if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
|
||||
if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) {
|
||||
$user = new stdClass;
|
||||
$user->ID = $current_user->ID;
|
||||
$user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) );
|
||||
@@ -109,7 +109,8 @@ if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $c
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
}
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) {
|
||||
} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
|
||||
check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
|
||||
delete_option( $current_user->ID . '_new_email' );
|
||||
wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
|
||||
die();
|
||||
@@ -406,7 +407,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
|
||||
$new_email = get_option( $current_user->ID . '_new_email' );
|
||||
if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
|
||||
<div class="updated inline">
|
||||
<p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>
|
||||
<p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), esc_html( $new_email['newemail'] ), esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ) ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
$menu[2] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
|
||||
$menu[2] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard');
|
||||
|
||||
$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );
|
||||
|
||||
$menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
|
||||
$menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
|
||||
|
||||
$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Eleven 1.7\n"
|
||||
"Project-Id-Version: Twenty Eleven 1.8\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentyeleven\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:24+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:26:59+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -431,11 +431,11 @@ msgid ""
|
||||
"in <a href=\"%6$s\" title=\"Return to %7$s\" rel=\"gallery\">%8$s</a>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-options.php:56 inc/theme-options.php:530
|
||||
#: inc/theme-options.php:56 inc/theme-options.php:528
|
||||
msgid "Color Scheme"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-options.php:62 inc/theme-options.php:547
|
||||
#: inc/theme-options.php:62 inc/theme-options.php:545
|
||||
msgid "Link Color"
|
||||
msgstr ""
|
||||
|
||||
@@ -534,40 +534,40 @@ msgstr ""
|
||||
msgid "%s Theme Options"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-options.php:554
|
||||
#: inc/theme-options.php:552
|
||||
msgid "Layout"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:23
|
||||
#: inc/widgets.php:21
|
||||
msgid ""
|
||||
"Use this widget to list your recent Aside, Status, Quote, and Link posts"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:24
|
||||
#: inc/widgets.php:22
|
||||
msgid "Twenty Eleven Ephemera"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:59
|
||||
#: inc/widgets.php:56
|
||||
msgid "Ephemera"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:98 inc/widgets.php:107
|
||||
#: inc/widgets.php:95 inc/widgets.php:104
|
||||
msgid "0 <span class=\"reply\">comments →</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:98 inc/widgets.php:107
|
||||
#: inc/widgets.php:95 inc/widgets.php:104
|
||||
msgid "1 <span class=\"reply\">comment →</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:98 inc/widgets.php:107
|
||||
#: inc/widgets.php:95 inc/widgets.php:104
|
||||
msgid "% <span class=\"reply\">comments →</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:170
|
||||
#: inc/widgets.php:167
|
||||
msgid "Title:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:173
|
||||
#: inc/widgets.php:170
|
||||
msgid "Number of posts to show:"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentyeleven
|
||||
Author: the WordPress team
|
||||
Author URI: http://wordpress.org/
|
||||
Description: The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -- then go further with available theme options for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, support for featured images (as custom header images on posts and pages and as large images on featured "sticky" posts), and special styles for six different post formats.
|
||||
Version: 1.7
|
||||
Version: 1.8
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Fourteen 1.0\n"
|
||||
"Project-Id-Version: Twenty Fourteen 1.1\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentyfourteen\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:26+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:29:37+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -85,19 +85,19 @@ msgstr ""
|
||||
|
||||
#: content-aside.php:37 content-audio.php:37 content-gallery.php:37
|
||||
#: content-image.php:37 content-link.php:37 content-quote.php:37
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:185
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:194
|
||||
msgid "Leave a comment"
|
||||
msgstr ""
|
||||
|
||||
#: content-aside.php:37 content-audio.php:37 content-gallery.php:37
|
||||
#: content-image.php:37 content-link.php:37 content-quote.php:37
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:185
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:194
|
||||
msgid "1 Comment"
|
||||
msgstr ""
|
||||
|
||||
#: content-aside.php:37 content-audio.php:37 content-gallery.php:37
|
||||
#: content-image.php:37 content-link.php:37 content-quote.php:37
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:185
|
||||
#: content-video.php:37 content.php:38 inc/widgets.php:194
|
||||
msgid "% Comments"
|
||||
msgstr ""
|
||||
|
||||
@@ -110,7 +110,7 @@ msgstr ""
|
||||
|
||||
#: content-aside.php:46 content-audio.php:46 content-gallery.php:46
|
||||
#: content-image.php:46 content-link.php:46 content-quote.php:46
|
||||
#: content-video.php:46 content.php:54 inc/widgets.php:118 inc/widgets.php:163
|
||||
#: content-video.php:46 content.php:54 inc/widgets.php:127 inc/widgets.php:172
|
||||
msgid "Continue reading <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
@@ -159,50 +159,50 @@ msgstr ""
|
||||
msgid "Secondary menu in left sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:175
|
||||
#: functions.php:171
|
||||
msgid "Primary Sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:177
|
||||
#: functions.php:173
|
||||
msgid "Main sidebar that appears on the left."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:184
|
||||
#: functions.php:180
|
||||
msgid "Content Sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:186
|
||||
#: functions.php:182
|
||||
msgid "Additional sidebar that appears on the right."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:193
|
||||
#: functions.php:189
|
||||
msgid "Footer Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:195
|
||||
#: functions.php:191
|
||||
msgid "Appears in the footer section of the site."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:217
|
||||
#: functions.php:213
|
||||
msgctxt "Lato font: on or off"
|
||||
msgid "on"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:260
|
||||
#: functions.php:254
|
||||
msgid "Previous"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:261
|
||||
#: functions.php:255
|
||||
msgid "Next"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:384
|
||||
#: functions.php:372
|
||||
msgid "%d Article"
|
||||
msgid_plural "%d Articles"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: functions.php:500
|
||||
#: functions.php:488
|
||||
msgid "Page %s"
|
||||
msgstr ""
|
||||
|
||||
@@ -226,7 +226,7 @@ msgstr ""
|
||||
msgid "Next Image"
|
||||
msgstr ""
|
||||
|
||||
#: inc/back-compat.php:41 inc/back-compat.php:53 inc/back-compat.php:68
|
||||
#: inc/back-compat.php:37 inc/back-compat.php:47 inc/back-compat.php:60
|
||||
msgid ""
|
||||
"Twenty Fourteen requires at least WordPress version 3.6. You are running "
|
||||
"version %s. Please upgrade and try again."
|
||||
@@ -244,18 +244,18 @@ msgstr ""
|
||||
msgid "Display Site Title & Tagline"
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:35 inc/featured-content.php:411
|
||||
#: inc/customizer.php:35 inc/featured-content.php:408
|
||||
msgid "Featured Content"
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:36 inc/featured-content.php:412
|
||||
#: inc/customizer.php:36 inc/featured-content.php:409
|
||||
msgid ""
|
||||
"Use a <a href=\"%1$s\">tag</a> to feature your posts. If no posts match the "
|
||||
"tag, <a href=\"%2$s\">sticky posts</a> will be displayed instead."
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:37 inc/customizer.php:104 inc/featured-content.php:413
|
||||
#: inc/featured-content.php:422 inc/featured-content.php:482
|
||||
#: inc/customizer.php:37 inc/customizer.php:102 inc/featured-content.php:410
|
||||
#: inc/featured-content.php:419 inc/featured-content.php:479
|
||||
msgctxt "featured content default tag slug"
|
||||
msgid "featured"
|
||||
msgstr ""
|
||||
@@ -274,20 +274,20 @@ msgstr ""
|
||||
|
||||
#. #-#-#-#-# twentyfourteen.pot (Twenty Fourteen 1.0) #-#-#-#-#
|
||||
#. Theme Name of the plugin/theme
|
||||
#: inc/customizer.php:101
|
||||
#: inc/customizer.php:99
|
||||
msgid "Twenty Fourteen"
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:104
|
||||
#: inc/customizer.php:102
|
||||
msgid ""
|
||||
"The home page features your choice of up to 6 posts prominently displayed in "
|
||||
"a grid or slider, controlled a <a href=\"%1$s\">tag</a>; you can change the "
|
||||
"tag and layout in <a href=\"%2$s\">Appearance → Customize</a>. If no "
|
||||
"posts match the tag, <a href=\"%3$s\">sticky posts</a> will be displayed "
|
||||
"a grid or slider, controlled by a <a href=\"%1$s\">tag</a>; you can change "
|
||||
"the tag and layout in <a href=\"%2$s\">Appearance → Customize</a>. If "
|
||||
"no posts match the tag, <a href=\"%3$s\">sticky posts</a> will be displayed "
|
||||
"instead."
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:105
|
||||
#: inc/customizer.php:103
|
||||
msgid ""
|
||||
"Enhance your site design by using <a href=\"%s\">Featured Images</a> for "
|
||||
"posts you’d like to stand out (also known as post thumbnails). This "
|
||||
@@ -296,110 +296,139 @@ msgid ""
|
||||
"title—and in the Featured Content area on the home page."
|
||||
msgstr ""
|
||||
|
||||
#: inc/customizer.php:106
|
||||
#: inc/customizer.php:104
|
||||
msgid ""
|
||||
"For an in-depth tutorial, and more tips and tricks, visit the <a href=\"%s"
|
||||
"\">Twenty Fourteen documentation</a>."
|
||||
msgstr ""
|
||||
|
||||
#: inc/featured-content.php:434
|
||||
#: inc/featured-content.php:431
|
||||
msgid "Tag Name"
|
||||
msgstr ""
|
||||
|
||||
#: inc/featured-content.php:439
|
||||
#: inc/featured-content.php:436
|
||||
msgid "Don’t display tag on front end."
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:47
|
||||
#: inc/template-tags.php:45
|
||||
msgid "← Previous"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:48
|
||||
#: inc/template-tags.php:46
|
||||
msgid "Next →"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:55
|
||||
#: inc/template-tags.php:53
|
||||
msgid "Posts navigation"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:84
|
||||
#: inc/template-tags.php:80
|
||||
msgid "Post navigation"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:88
|
||||
#: inc/template-tags.php:84
|
||||
msgid "<span class=\"meta-nav\">Published In</span>%title"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:90
|
||||
#: inc/template-tags.php:86
|
||||
msgid "<span class=\"meta-nav\">Previous Post</span>%title"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:91
|
||||
#: inc/template-tags.php:87
|
||||
msgid "<span class=\"meta-nav\">Next Post</span>%title"
|
||||
msgstr ""
|
||||
|
||||
#: inc/template-tags.php:110
|
||||
#: inc/template-tags.php:104
|
||||
msgid "Sticky"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:44
|
||||
#: inc/widgets.php:34
|
||||
msgid "Twenty Fourteen Ephemera"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:46
|
||||
#: inc/widgets.php:36
|
||||
msgid ""
|
||||
"Use this widget to list your recent Aside, Quote, Video, Audio, Image, "
|
||||
"Gallery, and Link posts."
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:53 taxonomy-post_format.php:30
|
||||
msgid "Asides"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:54 taxonomy-post_format.php:33
|
||||
msgid "Images"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:55 taxonomy-post_format.php:36
|
||||
#: inc/widgets.php:55
|
||||
msgid "More images"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:58 taxonomy-post_format.php:36
|
||||
msgid "Videos"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:56 taxonomy-post_format.php:39
|
||||
#: inc/widgets.php:59
|
||||
msgid "More videos"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:62 taxonomy-post_format.php:39
|
||||
msgid "Audio"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:57 taxonomy-post_format.php:42
|
||||
#: inc/widgets.php:63
|
||||
msgid "More audio"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:66 taxonomy-post_format.php:42
|
||||
msgid "Quotes"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:58 taxonomy-post_format.php:45
|
||||
#: inc/widgets.php:67
|
||||
msgid "More quotes"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:70 taxonomy-post_format.php:45
|
||||
msgid "Links"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:59 taxonomy-post_format.php:48
|
||||
#: inc/widgets.php:71
|
||||
msgid "More links"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:74 taxonomy-post_format.php:48
|
||||
msgid "Galleries"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:153
|
||||
#: inc/widgets.php:75
|
||||
msgid "More galleries"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:79 taxonomy-post_format.php:30
|
||||
msgid "Asides"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:80
|
||||
msgid "More asides"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:162
|
||||
msgid "This gallery contains <a href=\"%1$s\" rel=\"bookmark\">%2$s photo</a>."
|
||||
msgid_plural ""
|
||||
"This gallery contains <a href=\"%1$s\" rel=\"bookmark\">%2$s photos</a>."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
#: inc/widgets.php:194
|
||||
msgid "More %s <span class=\"meta-nav\">→</span>"
|
||||
#. translators: used with More archives link
|
||||
#: inc/widgets.php:206
|
||||
msgid "%s <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:242
|
||||
#: inc/widgets.php:255
|
||||
msgid "Title:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:245
|
||||
#: inc/widgets.php:258
|
||||
msgid "Number of posts to show:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/widgets.php:248
|
||||
#: inc/widgets.php:261
|
||||
msgid "Post format to show:"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentyfourteen
|
||||
Author: the WordPress team
|
||||
Author URI: http://wordpress.org/
|
||||
Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier.
|
||||
Version: 1.0
|
||||
Version: 1.1
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: black, green, white, light, dark, two-columns, three-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Thirteen 1.1\n"
|
||||
"Project-Id-Version: Twenty Thirteen 1.2\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentythirteen\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:26+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:28:45+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -179,71 +179,71 @@ msgctxt "Bitter font: on or off"
|
||||
msgid "on"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:220
|
||||
#: functions.php:218
|
||||
msgid "Page %s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:235
|
||||
#: functions.php:231
|
||||
msgid "Main Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:237
|
||||
#: functions.php:233
|
||||
msgid "Appears in the footer section of the site."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:245
|
||||
#: functions.php:241
|
||||
msgid "Secondary Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:247
|
||||
#: functions.php:243
|
||||
msgid "Appears on posts and pages in the sidebar."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:272
|
||||
#: functions.php:266
|
||||
msgid "Posts navigation"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:276
|
||||
#: functions.php:270
|
||||
msgid "<span class=\"meta-nav\">←</span> Older posts"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:280
|
||||
#: functions.php:274
|
||||
msgid "Newer posts <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:308
|
||||
#: functions.php:300
|
||||
msgid "Post navigation"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:311
|
||||
#: functions.php:303
|
||||
msgctxt "Previous post link"
|
||||
msgid "<span class=\"meta-nav\">←</span> %title"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:312
|
||||
#: functions.php:304
|
||||
msgctxt "Next post link"
|
||||
msgid "%title <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:332
|
||||
#: functions.php:322
|
||||
msgid "Sticky"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: used between list items, there is a space after the comma.
|
||||
#: functions.php:338 functions.php:344
|
||||
#: functions.php:328 functions.php:334
|
||||
msgid ", "
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:353
|
||||
#: functions.php:343
|
||||
msgid "View all posts by %s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:373
|
||||
#: functions.php:363
|
||||
msgctxt "1: post format name. 2: date"
|
||||
msgid "%1$s on %2$s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:379
|
||||
#: functions.php:369
|
||||
msgid "Permalink to %s"
|
||||
msgstr ""
|
||||
|
||||
@@ -278,23 +278,23 @@ msgstr ""
|
||||
msgid "Next <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: inc/back-compat.php:41 inc/back-compat.php:53 inc/back-compat.php:68
|
||||
#: inc/back-compat.php:37 inc/back-compat.php:47 inc/back-compat.php:60
|
||||
msgid ""
|
||||
"Twenty Thirteen requires at least WordPress version 3.6. You are running "
|
||||
"version %s. Please upgrade and try again."
|
||||
msgstr ""
|
||||
|
||||
#: inc/custom-header.php:51
|
||||
#: inc/custom-header.php:49
|
||||
msgctxt "header image description"
|
||||
msgid "Circle"
|
||||
msgstr ""
|
||||
|
||||
#: inc/custom-header.php:56
|
||||
#: inc/custom-header.php:54
|
||||
msgctxt "header image description"
|
||||
msgid "Diamond"
|
||||
msgstr ""
|
||||
|
||||
#: inc/custom-header.php:61
|
||||
#: inc/custom-header.php:59
|
||||
msgctxt "header image description"
|
||||
msgid "Star"
|
||||
msgstr ""
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentythirteen
|
||||
Author: the WordPress team
|
||||
Author URI: http://wordpress.org/
|
||||
Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
|
||||
Version: 1.1
|
||||
Version: 1.2
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# This file is distributed under the GNU General Public License v2 or later.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Twenty Twelve 1.3\n"
|
||||
"Project-Id-Version: Twenty Twelve 1.4\n"
|
||||
"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentytwelve\n"
|
||||
"POT-Creation-Date: 2014-03-18 19:16:25+00:00\n"
|
||||
"POT-Creation-Date: 2014-04-16 18:27:55+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
@@ -109,7 +109,7 @@ msgstr ""
|
||||
|
||||
#: content-aside.php:26 content-image.php:26 content-link.php:24
|
||||
#: content-page.php:24 content-quote.php:23 content-status.php:40
|
||||
#: content.php:51 functions.php:349 image.php:37
|
||||
#: content.php:51 functions.php:345 image.php:37
|
||||
msgid "Edit"
|
||||
msgstr ""
|
||||
|
||||
@@ -174,95 +174,95 @@ msgctxt "Open Sans font: add new subset (greek, cyrillic, vietnamese)"
|
||||
msgid "no-subset"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:215
|
||||
#: functions.php:213
|
||||
msgid "Page %s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:244
|
||||
#: functions.php:242
|
||||
msgid "Main Sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:246
|
||||
#: functions.php:244
|
||||
msgid ""
|
||||
"Appears on posts and pages except the optional Front Page template, which "
|
||||
"has its own widgets"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:254
|
||||
#: functions.php:252
|
||||
msgid "First Front Page Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:256 functions.php:266
|
||||
#: functions.php:254 functions.php:264
|
||||
msgid ""
|
||||
"Appears when using the optional Front Page template with a page set as "
|
||||
"Static Front Page"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:264
|
||||
#: functions.php:262
|
||||
msgid "Second Front Page Widget Area"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:288 single.php:20
|
||||
#: functions.php:286 single.php:20
|
||||
msgid "Post navigation"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:289
|
||||
#: functions.php:287
|
||||
msgid "<span class=\"meta-nav\">←</span> Older posts"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:290
|
||||
#: functions.php:288
|
||||
msgid "Newer posts <span class=\"meta-nav\">→</span>"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:317
|
||||
#: functions.php:313
|
||||
msgid "Pingback:"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:317
|
||||
#: functions.php:313
|
||||
msgid "(Edit)"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:332
|
||||
#: functions.php:328
|
||||
msgid "Post author"
|
||||
msgstr ""
|
||||
|
||||
#. translators: 1: date, 2: time
|
||||
#: functions.php:338
|
||||
#: functions.php:334
|
||||
msgid "%1$s at %2$s"
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:344
|
||||
#: functions.php:340
|
||||
msgid "Your comment is awaiting moderation."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:353
|
||||
#: functions.php:349
|
||||
msgid "Reply"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: used between list items, there is a space after the comma.
|
||||
#: functions.php:376 functions.php:379
|
||||
#: functions.php:370 functions.php:373
|
||||
msgid ", "
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:390
|
||||
#: functions.php:384
|
||||
msgid "View all posts by %s"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's
|
||||
#. name.
|
||||
#: functions.php:396
|
||||
#: functions.php:390
|
||||
msgid ""
|
||||
"This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author"
|
||||
"\"> by %4$s</span>."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:398
|
||||
#: functions.php:392
|
||||
msgid ""
|
||||
"This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</"
|
||||
"span>."
|
||||
msgstr ""
|
||||
|
||||
#: functions.php:400
|
||||
#: functions.php:394
|
||||
msgid "This entry was posted on %3$s<span class=\"by-author\"> by %4$s</span>."
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: http://wordpress.org/themes/twentytwelve
|
||||
Author: the WordPress team
|
||||
Author URI: http://wordpress.org/
|
||||
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
|
||||
Version: 1.3
|
||||
Version: 1.4
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: light, gray, white, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -519,11 +519,12 @@ class getid3_lib
|
||||
}
|
||||
|
||||
public static function XML2array($XMLstring) {
|
||||
if (function_exists('simplexml_load_string')) {
|
||||
if (function_exists('get_object_vars')) {
|
||||
$XMLobject = simplexml_load_string($XMLstring);
|
||||
return self::SimpleXMLelement2array($XMLobject);
|
||||
}
|
||||
if ( function_exists( 'simplexml_load_string' ) && function_exists( 'libxml_disable_entity_loader' ) ) {
|
||||
$loader = libxml_disable_entity_loader( true );
|
||||
$XMLobject = simplexml_load_string( $XMLstring, 'SimpleXMLElement', LIBXML_NOENT );
|
||||
$return = self::SimpleXMLelement2array( $XMLobject );
|
||||
libxml_disable_entity_loader( $loader );
|
||||
return $return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1100,8 +1100,10 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
case 'edit_post':
|
||||
case 'edit_page':
|
||||
$post = get_post( $args[0] );
|
||||
if ( empty( $post ) )
|
||||
if ( empty( $post ) ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
break;
|
||||
}
|
||||
|
||||
if ( 'revision' == $post->post_type ) {
|
||||
$post = get_post( $post->post_parent );
|
||||
@@ -1215,7 +1217,16 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
if ( empty( $comment ) )
|
||||
break;
|
||||
$post = get_post( $comment->comment_post_ID );
|
||||
$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
|
||||
|
||||
/*
|
||||
* If the post doesn't exist, we have an orphaned comment.
|
||||
* Fall back to the edit_posts capability, instead.
|
||||
*/
|
||||
if ( $post ) {
|
||||
$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
|
||||
} else {
|
||||
$caps = map_meta_cap( 'edit_posts', $user_id );
|
||||
}
|
||||
break;
|
||||
case 'unfiltered_upload':
|
||||
if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) ) )
|
||||
@@ -1347,21 +1358,25 @@ function current_user_can( $capability ) {
|
||||
* @return bool
|
||||
*/
|
||||
function current_user_can_for_blog( $blog_id, $capability ) {
|
||||
if ( is_multisite() )
|
||||
switch_to_blog( $blog_id );
|
||||
$switched = is_multisite() ? switch_to_blog( $blog_id ) : false;
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
if ( empty( $current_user ) )
|
||||
if ( empty( $current_user ) ) {
|
||||
if ( $switched ) {
|
||||
restore_current_blog();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$args = array_slice( func_get_args(), 2 );
|
||||
$args = array_merge( array( $capability ), $args );
|
||||
|
||||
$can = call_user_func_array( array( $current_user, 'has_cap' ), $args );
|
||||
|
||||
if ( is_multisite() )
|
||||
if ( $switched ) {
|
||||
restore_current_blog();
|
||||
}
|
||||
|
||||
return $can;
|
||||
}
|
||||
|
||||
@@ -203,11 +203,37 @@ class IXR_Message
|
||||
{
|
||||
// first remove the XML declaration
|
||||
// merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
|
||||
$header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr($this->message, 0, 100), 1);
|
||||
$this->message = substr_replace($this->message, $header, 0, 100);
|
||||
if (trim($this->message) == '') {
|
||||
$header = preg_replace( '/<\?xml.*?\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 );
|
||||
$this->message = trim( substr_replace( $this->message, $header, 0, 100 ) );
|
||||
if ( '' == $this->message ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Then remove the DOCTYPE
|
||||
$header = preg_replace( '/^<!DOCTYPE[^>]*+>/i', '', substr( $this->message, 0, 200 ), 1 );
|
||||
$this->message = trim( substr_replace( $this->message, $header, 0, 200 ) );
|
||||
if ( '' == $this->message ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that the root tag is valid
|
||||
$root_tag = substr( $this->message, 0, strcspn( substr( $this->message, 0, 20 ), "> \t\r\n" ) );
|
||||
if ( '<!DOCTYPE' === strtoupper( $root_tag ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( ! in_array( $root_tag, array( '<methodCall', '<methodResponse', '<fault' ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bail if there are too many elements to parse
|
||||
$element_limit = 30000;
|
||||
if ( function_exists( 'apply_filters' ) ) {
|
||||
$element_limit = apply_filters( 'xmlrpc_element_limit', $element_limit );
|
||||
}
|
||||
if ( $element_limit && 2 * $element_limit < substr_count( $this->message, '<' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_parser = xml_parser_create();
|
||||
// Set XML parser to take the case of tags in to account
|
||||
xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
|
||||
|
||||
@@ -214,6 +214,10 @@ class PasswordHash {
|
||||
|
||||
function HashPassword($password)
|
||||
{
|
||||
if ( strlen( $password ) > 4096 ) {
|
||||
return '*';
|
||||
}
|
||||
|
||||
$random = '';
|
||||
|
||||
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
|
||||
@@ -249,6 +253,10 @@ class PasswordHash {
|
||||
|
||||
function CheckPassword($password, $stored_hash)
|
||||
{
|
||||
if ( strlen( $password ) > 4096 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$hash = $this->crypt_private($password, $stored_hash);
|
||||
if ($hash[0] == '*')
|
||||
$hash = crypt($password, $stored_hash);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1119,22 +1119,19 @@ final class WP_Customize_Widgets {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a widget instance's hash key.
|
||||
* Get MAC for a serialized widget instance string.
|
||||
*
|
||||
* Serialize an instance and hash it with the AUTH_KEY; when a JS value is
|
||||
* posted back to save, this instance hash key is used to ensure that the
|
||||
* serialized_instance was not tampered with, but that it had originated
|
||||
* from WordPress and so is sanitized.
|
||||
* Allows values posted back from JS to be rejected if any tampering of the
|
||||
* data has occurred.
|
||||
*
|
||||
* @since 3.9.0
|
||||
* @access protected
|
||||
*
|
||||
* @param array $instance Widget instance.
|
||||
* @return string Widget instance's hash key.
|
||||
* @param string $serialized_instance Widget instance.
|
||||
* @return string MAC for serialized widget instance.
|
||||
*/
|
||||
protected function get_instance_hash_key( $instance ) {
|
||||
$hash = md5( AUTH_KEY . serialize( $instance ) );
|
||||
return $hash;
|
||||
protected function get_instance_hash_key( $serialized_instance ) {
|
||||
return wp_hash( $serialized_instance );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1162,18 +1159,19 @@ final class WP_Customize_Widgets {
|
||||
}
|
||||
|
||||
$decoded = base64_decode( $value['encoded_serialized_instance'], true );
|
||||
|
||||
if ( false === $decoded ) {
|
||||
return null;
|
||||
}
|
||||
$instance = unserialize( $decoded );
|
||||
|
||||
if ( ! hash_equals( $this->get_instance_hash_key( $decoded ), $value['instance_hash_key'] ) ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$instance = unserialize( $decoded );
|
||||
if ( false === $instance ) {
|
||||
return null;
|
||||
}
|
||||
if ( $this->get_instance_hash_key( $instance ) !== $value['instance_hash_key'] ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
@@ -1194,7 +1192,7 @@ final class WP_Customize_Widgets {
|
||||
'encoded_serialized_instance' => base64_encode( $serialized ),
|
||||
'title' => empty( $value['title'] ) ? '' : $value['title'],
|
||||
'is_widget_customizer_js_value' => true,
|
||||
'instance_hash_key' => $this->get_instance_hash_key( $value ),
|
||||
'instance_hash_key' => $this->get_instance_hash_key( $serialized ),
|
||||
);
|
||||
}
|
||||
return $value;
|
||||
|
||||
@@ -103,12 +103,6 @@ final class _WP_Editors {
|
||||
// A cookie (set when a user resizes the editor) overrides the height.
|
||||
$cookie = (int) get_user_setting( 'ed_size' );
|
||||
|
||||
// Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
|
||||
if ( ! $cookie && isset( $_COOKIE['TinyMCE_content_size'] ) ) {
|
||||
parse_str( $_COOKIE['TinyMCE_content_size'], $cookie );
|
||||
$cookie = $cookie['ch'];
|
||||
}
|
||||
|
||||
if ( $cookie )
|
||||
$set['editor_height'] = $cookie;
|
||||
}
|
||||
@@ -241,11 +235,11 @@ final class _WP_Editors {
|
||||
|
||||
if ( empty(self::$first_init) ) {
|
||||
if ( is_admin() ) {
|
||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js'), 50 );
|
||||
add_action( 'admin_footer', array( __CLASS__, 'enqueue_scripts'), 1 );
|
||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
|
||||
add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
|
||||
} else {
|
||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js'), 50 );
|
||||
add_action( 'wp_footer', array( __CLASS__, 'enqueue_scripts'), 1 );
|
||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
|
||||
add_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class WP_Embed {
|
||||
add_shortcode( 'embed', array( $this, 'shortcode' ) );
|
||||
|
||||
// Do the shortcode (only the [embed] one is registered)
|
||||
$content = do_shortcode( $content );
|
||||
$content = do_shortcode( $content, true );
|
||||
|
||||
// Put the original shortcodes back
|
||||
$shortcode_tags = $orig_shortcode_tags;
|
||||
@@ -291,7 +291,14 @@ class WP_Embed {
|
||||
* @return string Potentially modified $content.
|
||||
*/
|
||||
function autoembed( $content ) {
|
||||
return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
|
||||
// Replace line breaks from all HTML elements with placeholders.
|
||||
$content = wp_replace_in_html_tags( $content, array( "\n" => '<!-- wp-line-break -->' ) );
|
||||
|
||||
// Find URLs that are on their own line.
|
||||
$content = preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
|
||||
|
||||
// Put the line breaks back.
|
||||
return str_replace( '<!-- wp-line-break -->', "\n", $content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -216,7 +216,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
|
||||
$this->headers['Name'] = $this->stylesheet;
|
||||
if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), $this->stylesheet ) );
|
||||
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), esc_html( $this->stylesheet ) ) );
|
||||
else
|
||||
$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
|
||||
$this->template = $this->stylesheet;
|
||||
@@ -263,7 +263,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
$theme_root_template = $directories[ $this->template ]['theme_root'];
|
||||
} else {
|
||||
// Parent theme is missing.
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_no_parent', sprintf( __( 'The parent theme is missing. Please install the "%s" parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
$this->parent = new WP_Theme( $this->template, $this->theme_root, $this );
|
||||
return;
|
||||
@@ -275,11 +275,11 @@ final class WP_Theme implements ArrayAccess {
|
||||
// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
|
||||
if ( is_a( $_child, 'WP_Theme' ) && $_child->template == $this->stylesheet ) {
|
||||
$_child->parent = null;
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
|
||||
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $_child->template ) ) );
|
||||
$_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
|
||||
// The two themes actually reference each other with the Template header.
|
||||
if ( $_child->stylesheet == $this->template ) {
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $this->template ) );
|
||||
$this->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), esc_html( $this->template ) ) );
|
||||
$this->cache_add( 'theme', array( 'headers' => $this->headers, 'errors' => $this->errors, 'stylesheet' => $this->stylesheet, 'template' => $this->template ) );
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -1108,6 +1108,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.
|
||||
*
|
||||
@@ -1200,20 +1250,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4586,10 +4625,12 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
// Only posts can be sticky
|
||||
if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
|
||||
if ( $content_struct['sticky'] == true )
|
||||
stick_post( $post_ID );
|
||||
elseif ( $content_struct['sticky'] == false )
|
||||
unstick_post( $post_ID );
|
||||
$data = $postdata;
|
||||
$data['sticky'] = $content_struct['sticky'];
|
||||
$error = $this->_toggle_sticky( $data );
|
||||
if ( $error ) {
|
||||
return $error;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($content_struct['custom_fields']) )
|
||||
@@ -4862,11 +4903,12 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||
|
||||
$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
|
||||
|
||||
if ( ('publish' == $post_status) ) {
|
||||
if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
|
||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
|
||||
else if ( !current_user_can('publish_posts') )
|
||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
|
||||
if ( 'publish' == $post_status || 'private' == $post_status ) {
|
||||
if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) );
|
||||
} elseif ( ! current_user_can( 'publish_posts' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $post_more )
|
||||
@@ -4906,10 +4948,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']) )
|
||||
|
||||
@@ -13,23 +13,141 @@ if ( !function_exists('_') ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists('mb_substr') ):
|
||||
function mb_substr( $str, $start, $length=null, $encoding=null ) {
|
||||
return _mb_substr($str, $start, $length, $encoding);
|
||||
/**
|
||||
* Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.
|
||||
*
|
||||
* @ignore
|
||||
* @since 4.2.2
|
||||
* @access private
|
||||
*
|
||||
* @param bool $set - Used for testing only
|
||||
* null : default - get PCRE/u capability
|
||||
* false : Used for testing - return false for future calls to this function
|
||||
* 'reset': Used for testing - restore default behavior of this function
|
||||
*/
|
||||
function _wp_can_use_pcre_u( $set = null ) {
|
||||
static $utf8_pcre = 'reset';
|
||||
|
||||
if ( null !== $set ) {
|
||||
$utf8_pcre = $set;
|
||||
}
|
||||
|
||||
if ( 'reset' === $utf8_pcre ) {
|
||||
$utf8_pcre = @preg_match( '/^./u', 'a' );
|
||||
}
|
||||
|
||||
return $utf8_pcre;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'mb_substr' ) ) :
|
||||
function mb_substr( $str, $start, $length = null, $encoding = null ) {
|
||||
return _mb_substr( $str, $start, $length, $encoding );
|
||||
}
|
||||
endif;
|
||||
|
||||
function _mb_substr( $str, $start, $length=null, $encoding=null ) {
|
||||
// the solution below, works only for utf-8, so in case of a different
|
||||
// charset, just use built-in substr
|
||||
$charset = get_option( 'blog_charset' );
|
||||
if ( !in_array( $charset, array('utf8', 'utf-8', 'UTF8', 'UTF-8') ) ) {
|
||||
return is_null( $length )? substr( $str, $start ) : substr( $str, $start, $length);
|
||||
/*
|
||||
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
|
||||
* For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
|
||||
* The behavior of this function for invalid inputs is undefined.
|
||||
*/
|
||||
function _mb_substr( $str, $start, $length = null, $encoding = null ) {
|
||||
if ( null === $encoding ) {
|
||||
$encoding = get_option( 'blog_charset' );
|
||||
}
|
||||
// use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
$chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
|
||||
return implode( '', $chars );
|
||||
|
||||
// The solution below works only for UTF-8,
|
||||
// so in case of a different charset just use built-in substr()
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
return is_null( $length ) ? substr( $str, $start ) : substr( $str, $start, $length );
|
||||
}
|
||||
|
||||
if ( _wp_can_use_pcre_u() ) {
|
||||
// Use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
$chars = is_null( $length ) ? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
|
||||
return implode( '', $chars );
|
||||
}
|
||||
|
||||
$regex = '/(
|
||||
[\x00-\x7F] # single-byte sequences 0xxxxxxx
|
||||
| [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
|
||||
| \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2
|
||||
| [\xE1-\xEC][\x80-\xBF]{2}
|
||||
| \xED[\x80-\x9F][\x80-\xBF]
|
||||
| [\xEE-\xEF][\x80-\xBF]{2}
|
||||
| \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3
|
||||
| [\xF1-\xF3][\x80-\xBF]{3}
|
||||
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
||||
)/x';
|
||||
|
||||
$chars = array( '' ); // Start with 1 element instead of 0 since the first thing we do is pop
|
||||
do {
|
||||
// We had some string left over from the last round, but we counted it in that last round.
|
||||
array_pop( $chars );
|
||||
|
||||
// Split by UTF-8 character, limit to 1000 characters (last array element will contain the rest of the string)
|
||||
$pieces = preg_split( $regex, $str, 1000, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
|
||||
|
||||
$chars = array_merge( $chars, $pieces );
|
||||
} while ( count( $pieces ) > 1 && $str = array_pop( $pieces ) ); // If there's anything left over, repeat the loop.
|
||||
|
||||
return join( '', array_slice( $chars, $start, $length ) );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'mb_strlen' ) ) :
|
||||
function mb_strlen( $str, $encoding = null ) {
|
||||
return _mb_strlen( $str, $encoding );
|
||||
}
|
||||
endif;
|
||||
|
||||
/*
|
||||
* Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit.
|
||||
* For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
|
||||
* The behavior of this function for invalid inputs is undefined.
|
||||
*/
|
||||
function _mb_strlen( $str, $encoding = null ) {
|
||||
if ( null === $encoding ) {
|
||||
$encoding = get_option( 'blog_charset' );
|
||||
}
|
||||
|
||||
// The solution below works only for UTF-8,
|
||||
// so in case of a different charset just use built-in strlen()
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
|
||||
return strlen( $str );
|
||||
}
|
||||
|
||||
if ( _wp_can_use_pcre_u() ) {
|
||||
// Use the regex unicode support to separate the UTF-8 characters into an array
|
||||
preg_match_all( '/./us', $str, $match );
|
||||
return count( $match[0] );
|
||||
}
|
||||
|
||||
$regex = '/(?:
|
||||
[\x00-\x7F] # single-byte sequences 0xxxxxxx
|
||||
| [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
|
||||
| \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2
|
||||
| [\xE1-\xEC][\x80-\xBF]{2}
|
||||
| \xED[\x80-\x9F][\x80-\xBF]
|
||||
| [\xEE-\xEF][\x80-\xBF]{2}
|
||||
| \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3
|
||||
| [\xF1-\xF3][\x80-\xBF]{3}
|
||||
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
||||
)/x';
|
||||
|
||||
$count = 1; // Start at 1 instead of 0 since the first thing we do is decrement
|
||||
do {
|
||||
// We had some string left over from the last round, but we counted it in that last round.
|
||||
$count--;
|
||||
|
||||
// Split by UTF-8 character, limit to 1000 characters (last array element will contain the rest of the string)
|
||||
$pieces = preg_split( $regex, $str, 1000 );
|
||||
|
||||
// Increment
|
||||
$count += count( $pieces );
|
||||
} while ( $str = array_pop( $pieces ) ); // If there's anything left over, repeat the loop.
|
||||
|
||||
// Fencepost: preg_split() always returns one extra item in the array
|
||||
return --$count;
|
||||
}
|
||||
|
||||
if ( !function_exists('hash_hmac') ):
|
||||
@@ -94,3 +212,32 @@ if ( !function_exists('json_decode') ) {
|
||||
return is_array($data) ? array_map(__FUNCTION__, $data) : $data;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'hash_equals' ) ) :
|
||||
/**
|
||||
* Compare two strings in constant time.
|
||||
*
|
||||
* This function was added in PHP 5.6.
|
||||
* It can leak the length of a string.
|
||||
*
|
||||
* @since 3.9.2
|
||||
*
|
||||
* @param string $a Expected string.
|
||||
* @param string $b Actual string.
|
||||
* @return bool Whether strings are equal.
|
||||
*/
|
||||
function hash_equals( $a, $b ) {
|
||||
$a_length = strlen( $a );
|
||||
if ( $a_length !== strlen( $b ) ) {
|
||||
return false;
|
||||
}
|
||||
$result = 0;
|
||||
|
||||
// Do not attempt to "optimize" this.
|
||||
for ( $i = 0; $i < $a_length; $i++ ) {
|
||||
$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
|
||||
}
|
||||
|
||||
return $result === 0;
|
||||
}
|
||||
endif;
|
||||
@@ -279,6 +279,10 @@ div.mce-path {
|
||||
border-color: #bbb;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-listbox span {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.mce-panel .mce-btn i.mce-caret {
|
||||
border-top: 6px solid #777;
|
||||
margin-right: 2px;
|
||||
|
||||
2
wp-includes/css/editor-rtl.min.css
vendored
2
wp-includes/css/editor-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -279,6 +279,10 @@ div.mce-path {
|
||||
border-color: #bbb;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-listbox span {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.mce-panel .mce-btn i.mce-caret {
|
||||
border-top: 6px solid #777;
|
||||
margin-left: 2px;
|
||||
|
||||
2
wp-includes/css/editor.min.css
vendored
2
wp-includes/css/editor.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1781,7 +1781,8 @@
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.media-embed .setting input.hidden {
|
||||
.media-embed .setting input.hidden,
|
||||
.media-embed .setting textarea.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
2
wp-includes/css/media-views-rtl.min.css
vendored
2
wp-includes/css/media-views-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1781,7 +1781,8 @@
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.media-embed .setting input.hidden {
|
||||
.media-embed .setting input.hidden,
|
||||
.media-embed .setting textarea.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
2
wp-includes/css/media-views.min.css
vendored
2
wp-includes/css/media-views.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -732,7 +732,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||
$cache[ $args['widget_id'] ] = ob_get_flush();
|
||||
wp_cache_set( 'widget_recent_posts', $cache, 'widget' );
|
||||
} else {
|
||||
ob_flush();
|
||||
ob_end_flush();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1343,16 +1343,17 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $title ); ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:'); ?></label>
|
||||
<select id="<?php echo $this->get_field_id('nav_menu'); ?>" name="<?php echo $this->get_field_name('nav_menu'); ?>">
|
||||
<option value="0"><?php _e( '— Select —' ) ?></option>
|
||||
<?php
|
||||
foreach ( $menus as $menu ) {
|
||||
echo '<option value="' . $menu->term_id . '"'
|
||||
. selected( $nav_menu, $menu->term_id, false )
|
||||
. '>'. $menu->name . '</option>';
|
||||
. '>'. esc_html( $menu->name ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
@@ -152,7 +152,14 @@ function wptexturize($text) {
|
||||
$no_texturize_tags_stack = array();
|
||||
$no_texturize_shortcodes_stack = array();
|
||||
|
||||
$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
// Look for shortcodes and HTML elements.
|
||||
|
||||
$shortcode_regex =
|
||||
'\[' // Find start of shortcode.
|
||||
. '[^\[\]<>]++' // Shortcodes do not contain other shortcodes. Possessive critical.
|
||||
. '\]'; // Find end of shortcode.
|
||||
|
||||
$textarr = preg_split("/(<[^>]*>|$shortcode_regex)/s", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
foreach ( $textarr as &$curl ) {
|
||||
if ( empty( $curl ) ) {
|
||||
@@ -163,7 +170,7 @@ function wptexturize($text) {
|
||||
$first = $curl[0];
|
||||
if ( '<' === $first ) {
|
||||
_wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
|
||||
} elseif ( '[' === $first ) {
|
||||
} elseif ( '[' === $first && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) {
|
||||
_wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
|
||||
} elseif ( empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack) ) {
|
||||
|
||||
@@ -214,6 +221,8 @@ function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $openi
|
||||
|
||||
array_push($stack, $matches[1]);
|
||||
}
|
||||
} elseif ( 0 == count( $stack ) ) {
|
||||
// Stack is empty. Just stop.
|
||||
} else {
|
||||
// Closing? Check $text+2 against disabled elements
|
||||
$c = preg_quote($closing, '/');
|
||||
@@ -282,6 +291,9 @@ function wpautop($pee, $br = true) {
|
||||
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
|
||||
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
|
||||
|
||||
// Find newlines in all elements and add placeholders.
|
||||
$pee = wp_replace_in_html_tags( $pee, array( "\n" => " <!-- wpnl --> " ) );
|
||||
|
||||
if ( strpos( $pee, '</object>' ) !== false ) {
|
||||
// no P/BR around param and embed
|
||||
$pee = preg_replace( '|(<object[^>]*>)\s*|', '$1', $pee );
|
||||
@@ -327,9 +339,109 @@ function wpautop($pee, $br = true) {
|
||||
if ( !empty($pre_tags) )
|
||||
$pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee);
|
||||
|
||||
// Restore newlines in all elements.
|
||||
$pee = str_replace( " <!-- wpnl --> ", "\n", $pee );
|
||||
|
||||
return $pee;
|
||||
}
|
||||
|
||||
/**
|
||||
* Separate HTML elements and comments from the text.
|
||||
*
|
||||
* @since 4.2.4
|
||||
*
|
||||
* @param string $input The text which has to be formatted.
|
||||
* @return array The formatted text.
|
||||
*/
|
||||
function wp_html_split( $input ) {
|
||||
static $regex;
|
||||
|
||||
if ( ! isset( $regex ) ) {
|
||||
$comments =
|
||||
'!' // Start of comment, after the <.
|
||||
. '(?:' // Unroll the loop: Consume everything until --> is found.
|
||||
. '-(?!->)' // Dash not followed by end of comment.
|
||||
. '[^\-]*+' // Consume non-dashes.
|
||||
. ')*+' // Loop possessively.
|
||||
. '(?:-->)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$cdata =
|
||||
'!\[CDATA\[' // Start of comment, after the <.
|
||||
. '[^\]]*+' // Consume non-].
|
||||
. '(?:' // Unroll the loop: Consume everything until ]]> is found.
|
||||
. '](?!]>)' // One ] not followed by end of comment.
|
||||
. '[^\]]*+' // Consume non-].
|
||||
. ')*+' // Loop possessively.
|
||||
. '(?:]]>)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$regex =
|
||||
'/(' // Capture the entire match.
|
||||
. '<' // Find start of element.
|
||||
. '(?(?=!--)' // Is this a comment?
|
||||
. $comments // Find end of comment.
|
||||
. '|'
|
||||
. '(?(?=!\[CDATA\[)' // Is this a comment?
|
||||
. $cdata // Find end of comment.
|
||||
. '|'
|
||||
. '[^>]*>?' // Find end of element. If not found, match all input.
|
||||
. ')'
|
||||
. ')'
|
||||
. ')/s';
|
||||
}
|
||||
|
||||
return preg_split( $regex, $input, -1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace characters or phrases within HTML elements only.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $haystack The text which has to be formatted.
|
||||
* @param array $replace_pairs In the form array('from' => 'to', ...).
|
||||
* @return string The formatted text.
|
||||
*/
|
||||
function wp_replace_in_html_tags( $haystack, $replace_pairs ) {
|
||||
// Find all elements.
|
||||
$textarr = wp_html_split( $haystack );
|
||||
$changed = false;
|
||||
|
||||
// Optimize when searching for one item.
|
||||
if ( 1 === count( $replace_pairs ) ) {
|
||||
// Extract $needle and $replace.
|
||||
foreach ( $replace_pairs as $needle => $replace );
|
||||
|
||||
// Loop through delimeters (elements) only.
|
||||
for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
|
||||
if ( false !== strpos( $textarr[$i], $needle ) ) {
|
||||
$textarr[$i] = str_replace( $needle, $replace, $textarr[$i] );
|
||||
$changed = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Extract all $needles.
|
||||
$needles = array_keys( $replace_pairs );
|
||||
|
||||
// Loop through delimeters (elements) only.
|
||||
for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
|
||||
foreach ( $needles as $needle ) {
|
||||
if ( false !== strpos( $textarr[$i], $needle ) ) {
|
||||
$textarr[$i] = strtr( $textarr[$i], $replace_pairs );
|
||||
$changed = true;
|
||||
// After one strtr() break out of the foreach loop and look at next element.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $changed ) {
|
||||
$haystack = implode( $textarr );
|
||||
}
|
||||
|
||||
return $haystack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Newline preservation help function for wpautop
|
||||
*
|
||||
@@ -1169,21 +1281,23 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures a string is a valid SQL order by clause.
|
||||
* Ensures a string is a valid SQL 'order by' clause.
|
||||
*
|
||||
* Accepts one or more columns, with or without ASC/DESC, and also accepts
|
||||
* RAND().
|
||||
* Accepts one or more columns, with or without a sort order (ASC / DESC).
|
||||
* e.g. 'column_1', 'column_1, column_2', 'column_1 ASC, column_2 DESC' etc.
|
||||
*
|
||||
* Also accepts 'RAND()'.
|
||||
*
|
||||
* @since 2.5.1
|
||||
*
|
||||
* @param string $orderby Order by string to be checked.
|
||||
* @return string|bool Returns the order by clause if it is a match, false otherwise.
|
||||
* @param string $orderby Order by clause to be validated.
|
||||
* @return string|bool Returns $orderby if valid, false otherwise.
|
||||
*/
|
||||
function sanitize_sql_orderby( $orderby ){
|
||||
preg_match('/^\s*([a-z0-9_]+(\s+(ASC|DESC))?(\s*,\s*|\s*$))+|^\s*RAND\(\s*\)\s*$/i', $orderby, $obmatches);
|
||||
if ( !$obmatches )
|
||||
return false;
|
||||
return $orderby;
|
||||
function sanitize_sql_orderby( $orderby ) {
|
||||
if ( preg_match( '/^\s*(([a-z0-9_]+|`[a-z0-9_]+`)(\s+(ASC|DESC))?\s*(,\s*(?=[a-z0-9_`])|$))+$/i', $orderby ) || preg_match( '/^\s*RAND\(\s*\)\s*$/i', $orderby ) ) {
|
||||
return $orderby;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -451,8 +451,9 @@ function send_origin_headers() {
|
||||
* @return mixed URL or false on failure.
|
||||
*/
|
||||
function wp_http_validate_url( $url ) {
|
||||
$original_url = $url;
|
||||
$url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );
|
||||
if ( ! $url )
|
||||
if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) )
|
||||
return false;
|
||||
|
||||
$parsed_url = @parse_url( $url );
|
||||
@@ -462,7 +463,7 @@ function wp_http_validate_url( $url ) {
|
||||
if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) )
|
||||
return false;
|
||||
|
||||
if ( false !== strpos( $parsed_url['host'], ':' ) )
|
||||
if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) )
|
||||
return false;
|
||||
|
||||
$parsed_home = @parse_url( get_option( 'home' ) );
|
||||
@@ -471,7 +472,7 @@ function wp_http_validate_url( $url ) {
|
||||
|
||||
if ( ! $same_host ) {
|
||||
$host = trim( $parsed_url['host'], '.' );
|
||||
if ( preg_match( '#^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $host ) ) {
|
||||
if ( preg_match( '#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host ) ) {
|
||||
$ip = $host;
|
||||
} else {
|
||||
$ip = gethostbyname( $host );
|
||||
@@ -480,8 +481,7 @@ function wp_http_validate_url( $url ) {
|
||||
}
|
||||
if ( $ip ) {
|
||||
$parts = array_map( 'intval', explode( '.', $ip ) );
|
||||
if ( '127.0.0.1' === $ip
|
||||
|| ( 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] )
|
||||
) {
|
||||
|
||||
@@ -113,6 +113,10 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.get('imageWidth') <= this.get('themeWidth')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
2
wp-includes/js/customize-models.min.js
vendored
2
wp-includes/js/customize-models.min.js
vendored
@@ -1 +1 @@
|
||||
!function(a,b){var c=b.customize;c.HeaderTool={},c.HeaderTool.ImageModel=Backbone.Model.extend({defaults:function(){return{header:{attachment_id:0,url:"",timestamp:_.now(),thumbnail_url:""},choice:"",selected:!1,random:!1}},initialize:function(){this.on("hide",this.hide,this)},hide:function(){this.set("choice",""),c("header_image").set("remove-header"),c("header_image_data").set("remove-header")},destroy:function(){var a=this.get("header"),d=c.HeaderTool.currentHeader.get("header").attachment_id;d&&a.attachment_id===d&&c.HeaderTool.currentHeader.trigger("hide"),b.ajax.post("custom-header-remove",{nonce:_wpCustomizeHeader.nonces.remove,wp_customize:"on",theme:c.settings.theme.stylesheet,attachment_id:a.attachment_id}),this.trigger("destroy",this,this.collection)},save:function(){this.get("random")?(c("header_image").set(this.get("header").random),c("header_image_data").set(this.get("header").random)):this.get("header").defaultName?(c("header_image").set(this.get("header").url),c("header_image_data").set(this.get("header").defaultName)):(c("header_image").set(this.get("header").url),c("header_image_data").set(this.get("header"))),c.HeaderTool.combinedList.trigger("control:setImage",this)},importImage:function(){var a=this.get("header");void 0!==a.attachment_id&&b.ajax.post("custom-header-add",{nonce:_wpCustomizeHeader.nonces.add,wp_customize:"on",theme:c.settings.theme.stylesheet,attachment_id:a.attachment_id})},shouldBeCropped:function(){return this.get("themeFlexWidth")===!0&&this.get("themeFlexHeight")===!0?!1:this.get("themeFlexWidth")===!0&&this.get("themeHeight")===this.get("imageHeight")?!1:this.get("themeFlexHeight")===!0&&this.get("themeWidth")===this.get("imageWidth")?!1:this.get("themeWidth")===this.get("imageWidth")&&this.get("themeHeight")===this.get("imageHeight")?!1:!0}}),c.HeaderTool.ChoiceList=Backbone.Collection.extend({model:c.HeaderTool.ImageModel,comparator:function(a){return-a.get("header").timestamp},initialize:function(){var a=c.HeaderTool.currentHeader.get("choice").replace(/^https?:\/\//,""),b=this.isRandomChoice(c.get().header_image);this.type||(this.type="uploaded"),"undefined"==typeof this.data&&(this.data=_wpCustomizeHeader.uploads),b&&(a=c.get().header_image),this.on("control:setImage",this.setImage,this),this.on("control:removeImage",this.removeImage,this),this.on("add",this.maybeAddRandomChoice,this),_.each(this.data,function(b,c){b.attachment_id||(b.defaultName=c),"undefined"==typeof b.timestamp&&(b.timestamp=0),this.add({header:b,choice:b.url.split("/").pop(),selected:a===b.url.replace(/^https?:\/\//,"")},{silent:!0})},this),this.size()>0&&this.addRandomChoice(a)},maybeAddRandomChoice:function(){1===this.size()&&this.addRandomChoice()},addRandomChoice:function(a){var b=RegExp(this.type).test(a),c="random-"+this.type+"-image";this.add({header:{timestamp:0,random:c,width:245,height:41},choice:c,random:!0,selected:b})},isRandomChoice:function(a){return/^random-(uploaded|default)-image$/.test(a)},shouldHideTitle:function(){return this.size()<2},setImage:function(a){this.each(function(a){a.set("selected",!1)}),a&&a.set("selected",!0)},removeImage:function(){this.each(function(a){a.set("selected",!1)})}}),c.HeaderTool.DefaultsList=c.HeaderTool.ChoiceList.extend({initialize:function(){this.type="default",this.data=_wpCustomizeHeader.defaults,c.HeaderTool.ChoiceList.prototype.initialize.apply(this)}})}(jQuery,window.wp);
|
||||
!function(a,b){var c=b.customize;c.HeaderTool={},c.HeaderTool.ImageModel=Backbone.Model.extend({defaults:function(){return{header:{attachment_id:0,url:"",timestamp:_.now(),thumbnail_url:""},choice:"",selected:!1,random:!1}},initialize:function(){this.on("hide",this.hide,this)},hide:function(){this.set("choice",""),c("header_image").set("remove-header"),c("header_image_data").set("remove-header")},destroy:function(){var a=this.get("header"),d=c.HeaderTool.currentHeader.get("header").attachment_id;d&&a.attachment_id===d&&c.HeaderTool.currentHeader.trigger("hide"),b.ajax.post("custom-header-remove",{nonce:_wpCustomizeHeader.nonces.remove,wp_customize:"on",theme:c.settings.theme.stylesheet,attachment_id:a.attachment_id}),this.trigger("destroy",this,this.collection)},save:function(){this.get("random")?(c("header_image").set(this.get("header").random),c("header_image_data").set(this.get("header").random)):this.get("header").defaultName?(c("header_image").set(this.get("header").url),c("header_image_data").set(this.get("header").defaultName)):(c("header_image").set(this.get("header").url),c("header_image_data").set(this.get("header"))),c.HeaderTool.combinedList.trigger("control:setImage",this)},importImage:function(){var a=this.get("header");void 0!==a.attachment_id&&b.ajax.post("custom-header-add",{nonce:_wpCustomizeHeader.nonces.add,wp_customize:"on",theme:c.settings.theme.stylesheet,attachment_id:a.attachment_id})},shouldBeCropped:function(){return this.get("themeFlexWidth")===!0&&this.get("themeFlexHeight")===!0?!1:this.get("themeFlexWidth")===!0&&this.get("themeHeight")===this.get("imageHeight")?!1:this.get("themeFlexHeight")===!0&&this.get("themeWidth")===this.get("imageWidth")?!1:this.get("themeWidth")===this.get("imageWidth")&&this.get("themeHeight")===this.get("imageHeight")?!1:this.get("imageWidth")<=this.get("themeWidth")?!1:!0}}),c.HeaderTool.ChoiceList=Backbone.Collection.extend({model:c.HeaderTool.ImageModel,comparator:function(a){return-a.get("header").timestamp},initialize:function(){var a=c.HeaderTool.currentHeader.get("choice").replace(/^https?:\/\//,""),b=this.isRandomChoice(c.get().header_image);this.type||(this.type="uploaded"),"undefined"==typeof this.data&&(this.data=_wpCustomizeHeader.uploads),b&&(a=c.get().header_image),this.on("control:setImage",this.setImage,this),this.on("control:removeImage",this.removeImage,this),this.on("add",this.maybeAddRandomChoice,this),_.each(this.data,function(b,c){b.attachment_id||(b.defaultName=c),"undefined"==typeof b.timestamp&&(b.timestamp=0),this.add({header:b,choice:b.url.split("/").pop(),selected:a===b.url.replace(/^https?:\/\//,"")},{silent:!0})},this),this.size()>0&&this.addRandomChoice(a)},maybeAddRandomChoice:function(){1===this.size()&&this.addRandomChoice()},addRandomChoice:function(a){var b=RegExp(this.type).test(a),c="random-"+this.type+"-image";this.add({header:{timestamp:0,random:c,width:245,height:41},choice:c,random:!0,selected:b})},isRandomChoice:function(a){return/^random-(uploaded|default)-image$/.test(a)},shouldHideTitle:function(){return this.size()<2},setImage:function(a){this.each(function(a){a.set("selected",!1)}),a&&a.set("selected",!0)},removeImage:function(){this.each(function(a){a.set("selected",!1)})}}),c.HeaderTool.DefaultsList=c.HeaderTool.ChoiceList.extend({initialize:function(){this.type="default",this.data=_wpCustomizeHeader.defaults,c.HeaderTool.ChoiceList.prototype.initialize.apply(this)}})}(jQuery,window.wp);
|
||||
@@ -70,7 +70,7 @@
|
||||
},
|
||||
|
||||
setButtons: function() {
|
||||
var elements = $('.actions .remove');
|
||||
var elements = $('#customize-control-header_image .actions .remove');
|
||||
if (this.model.get('choice')) {
|
||||
elements.show();
|
||||
} else {
|
||||
|
||||
2
wp-includes/js/customize-views.min.js
vendored
2
wp-includes/js/customize-views.min.js
vendored
@@ -1 +1 @@
|
||||
!function(a,b,c){if(b&&b.customize){var d=b.customize;d.HeaderTool.CurrentView=b.Backbone.View.extend({template:b.template("header-current"),initialize:function(){this.listenTo(this.model,"change",this.render),this.render()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.setPlaceholder(),this.setButtons(),this},getHeight:function(){var a,b,c,e=this.$el.find("img");return e.length?(this.$el.find(".inner").hide(),a=this.model.get("savedHeight"),b=e.height()||a,b||(c=d.get().header_image_data,b=c&&c.width&&c.height?260/c.width*c.height:40),b):(this.$el.find(".inner").show(),40)},setPlaceholder:function(a){var b=a||this.getHeight();this.model.set("savedHeight",b),this.$el.add(this.$el.find(".placeholder")).height(b)},setButtons:function(){var b=a(".actions .remove");this.model.get("choice")?b.show():b.hide()}}),d.HeaderTool.ChoiceView=b.Backbone.View.extend({template:b.template("header-choice"),className:"header-view",events:{"click .choice,.random":"select","click .close":"removeImage"},initialize:function(){var a=[this.model.get("header").url,this.model.get("choice")];this.listenTo(this.model,"change:selected",this.toggleSelected),c.contains(a,d.get().header_image)&&d.HeaderTool.currentHeader.set(this.extendedModel())},render:function(){return this.$el.html(this.template(this.extendedModel())),this.toggleSelected(),this},toggleSelected:function(){this.$el.toggleClass("selected",this.model.get("selected"))},extendedModel:function(){var a=this.model.get("collection");return c.extend(this.model.toJSON(),{type:a.type})},getHeight:d.HeaderTool.CurrentView.prototype.getHeight,setPlaceholder:d.HeaderTool.CurrentView.prototype.setPlaceholder,select:function(){this.preventJump(),this.model.save(),d.HeaderTool.currentHeader.set(this.extendedModel())},preventJump:function(){var b=a(".wp-full-overlay-sidebar-content"),d=b.scrollTop();c.defer(function(){b.scrollTop(d)})},removeImage:function(a){a.stopPropagation(),this.model.destroy(),this.remove()}}),d.HeaderTool.ChoiceListView=b.Backbone.View.extend({initialize:function(){this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"sort",this.render),this.listenTo(this.collection,"change",this.toggleList),this.render()},render:function(){this.$el.empty(),this.collection.each(this.addOne,this),this.toggleList()},addOne:function(a){var b;a.set({collection:this.collection}),b=new d.HeaderTool.ChoiceView({model:a}),this.$el.append(b.render().el)},toggleList:function(){var a=this.$el.parents().prev(".customize-control-title"),b=this.$el.find(".random").parent();this.collection.shouldHideTitle()?a.add(b).hide():a.add(b).show()}}),d.HeaderTool.CombinedList=b.Backbone.View.extend({initialize:function(a){this.collections=a,this.on("all",this.propagate,this)},propagate:function(a,b){c.each(this.collections,function(c){c.trigger(a,b)})}})}}(jQuery,window.wp,_);
|
||||
!function(a,b,c){if(b&&b.customize){var d=b.customize;d.HeaderTool.CurrentView=b.Backbone.View.extend({template:b.template("header-current"),initialize:function(){this.listenTo(this.model,"change",this.render),this.render()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.setPlaceholder(),this.setButtons(),this},getHeight:function(){var a,b,c,e=this.$el.find("img");return e.length?(this.$el.find(".inner").hide(),a=this.model.get("savedHeight"),b=e.height()||a,b||(c=d.get().header_image_data,b=c&&c.width&&c.height?260/c.width*c.height:40),b):(this.$el.find(".inner").show(),40)},setPlaceholder:function(a){var b=a||this.getHeight();this.model.set("savedHeight",b),this.$el.add(this.$el.find(".placeholder")).height(b)},setButtons:function(){var b=a("#customize-control-header_image .actions .remove");this.model.get("choice")?b.show():b.hide()}}),d.HeaderTool.ChoiceView=b.Backbone.View.extend({template:b.template("header-choice"),className:"header-view",events:{"click .choice,.random":"select","click .close":"removeImage"},initialize:function(){var a=[this.model.get("header").url,this.model.get("choice")];this.listenTo(this.model,"change:selected",this.toggleSelected),c.contains(a,d.get().header_image)&&d.HeaderTool.currentHeader.set(this.extendedModel())},render:function(){return this.$el.html(this.template(this.extendedModel())),this.toggleSelected(),this},toggleSelected:function(){this.$el.toggleClass("selected",this.model.get("selected"))},extendedModel:function(){var a=this.model.get("collection");return c.extend(this.model.toJSON(),{type:a.type})},getHeight:d.HeaderTool.CurrentView.prototype.getHeight,setPlaceholder:d.HeaderTool.CurrentView.prototype.setPlaceholder,select:function(){this.preventJump(),this.model.save(),d.HeaderTool.currentHeader.set(this.extendedModel())},preventJump:function(){var b=a(".wp-full-overlay-sidebar-content"),d=b.scrollTop();c.defer(function(){b.scrollTop(d)})},removeImage:function(a){a.stopPropagation(),this.model.destroy(),this.remove()}}),d.HeaderTool.ChoiceListView=b.Backbone.View.extend({initialize:function(){this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"sort",this.render),this.listenTo(this.collection,"change",this.toggleList),this.render()},render:function(){this.$el.empty(),this.collection.each(this.addOne,this),this.toggleList()},addOne:function(a){var b;a.set({collection:this.collection}),b=new d.HeaderTool.ChoiceView({model:a}),this.$el.append(b.render().el)},toggleList:function(){var a=this.$el.parents().prev(".customize-control-title"),b=this.$el.find(".random").parent();this.collection.shouldHideTitle()?a.add(b).hide():a.add(b).show()}}),d.HeaderTool.CombinedList=b.Backbone.View.extend({initialize:function(a){this.collections=a,this.on("all",this.propagate,this)},propagate:function(a,b){c.each(this.collections,function(c){c.trigger(a,b)})}})}}(jQuery,window.wp,_);
|
||||
@@ -451,10 +451,6 @@ window.wp = window.wp || {};
|
||||
firefox = this.ua.is( 'ff' ),
|
||||
className = '.wp-' + this.shortcode.tag + '-shortcode';
|
||||
|
||||
if ( this.player ) {
|
||||
this.unsetPlayer();
|
||||
}
|
||||
|
||||
media = $( node ).find( className );
|
||||
|
||||
if ( ! this.isCompatible( media ) ) {
|
||||
@@ -487,20 +483,17 @@ window.wp = window.wp || {};
|
||||
* @returns {string}
|
||||
*/
|
||||
getHtml: function() {
|
||||
var attrs = _.defaults(
|
||||
this.shortcode.attrs.named,
|
||||
wp.media[ this.shortcode.tag ].defaults
|
||||
);
|
||||
return this.template({ model: attrs });
|
||||
var attrs = this.shortcode.attrs.named;
|
||||
attrs.content = this.shortcode.content;
|
||||
|
||||
return this.template({ model: _.defaults(
|
||||
attrs,
|
||||
wp.media[ this.shortcode.tag ].defaults )
|
||||
});
|
||||
},
|
||||
|
||||
unbind: function() {
|
||||
var self = this;
|
||||
this.pauseAllPlayers();
|
||||
_.each( this.players, function (player) {
|
||||
self.removePlayer( player );
|
||||
} );
|
||||
this.players = [];
|
||||
this.unsetPlayers();
|
||||
}
|
||||
});
|
||||
_.extend( wp.mce.media.View.prototype, wp.media.mixin );
|
||||
@@ -547,22 +540,10 @@ window.wp = window.wp || {};
|
||||
template: media.template('editor-playlist'),
|
||||
|
||||
initialize: function( options ) {
|
||||
this.players = [];
|
||||
this.data = {};
|
||||
this.attachments = [];
|
||||
this.shortcode = options.shortcode;
|
||||
_.bindAll( this, 'setPlayer' );
|
||||
$(this).on('ready', this.setNode);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the element context for the view, and then fetch the playlist's
|
||||
* associated attachments.
|
||||
*
|
||||
* @param {Event} e
|
||||
* @param {HTMLElement} node
|
||||
*/
|
||||
setNode: function(e, node) {
|
||||
this.node = node;
|
||||
this.fetch();
|
||||
},
|
||||
|
||||
@@ -571,7 +552,7 @@ window.wp = window.wp || {};
|
||||
*/
|
||||
fetch: function() {
|
||||
this.attachments = wp.media.playlist.attachments( this.shortcode );
|
||||
this.attachments.more().done( this.setPlayer );
|
||||
this.dfd = this.attachments.more().done( _.bind( this.render, this ) );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -582,36 +563,31 @@ window.wp = window.wp || {};
|
||||
* @global WPPlaylistView
|
||||
* @global tinymce.editors
|
||||
*/
|
||||
setPlayer: function() {
|
||||
var p,
|
||||
html = this.getHtml(),
|
||||
t = this.encodedText,
|
||||
self = this;
|
||||
|
||||
this.unsetPlayer();
|
||||
render: function() {
|
||||
var html = this.getHtml(), self = this;
|
||||
|
||||
_.each( tinymce.editors, function( editor ) {
|
||||
var doc;
|
||||
if ( editor.plugins.wpview ) {
|
||||
doc = editor.getDoc();
|
||||
$( doc ).find( '[data-wpview-text="' + t + '"]' ).each(function(i, elem) {
|
||||
$( doc ).find( '[data-wpview-text="' + this.encodedText + '"]' ).each(function (i, elem) {
|
||||
var node = $( elem );
|
||||
node.html( html );
|
||||
self.node = elem;
|
||||
|
||||
// The <ins> is used to mark the end of the wrapper div. Needed when comparing
|
||||
// the content as string for preventing extra undo levels.
|
||||
node.html( html ).append( '<ins data-wpview-end="1"></ins>' );
|
||||
|
||||
if ( ! self.data.tracks ) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.players.push( new WPPlaylistView({
|
||||
el: $( elem ).find( '.wp-playlist' ).get(0),
|
||||
metadata: self.data
|
||||
}).player );
|
||||
});
|
||||
}
|
||||
}, this );
|
||||
|
||||
if ( ! this.data.tracks ) {
|
||||
return;
|
||||
}
|
||||
|
||||
p = new WPPlaylistView({
|
||||
el: $( self.node ).find( '.wp-playlist' ).get(0),
|
||||
metadata: this.data
|
||||
});
|
||||
|
||||
this.player = p._player;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -695,6 +671,10 @@ window.wp = window.wp || {};
|
||||
this.data = options;
|
||||
|
||||
return this.template( options );
|
||||
},
|
||||
|
||||
unbind: function() {
|
||||
this.unsetPlayers();
|
||||
}
|
||||
});
|
||||
_.extend( wp.mce.media.PlaylistView.prototype, wp.media.mixin );
|
||||
|
||||
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
@@ -162,11 +162,13 @@
|
||||
*
|
||||
* Examples: modal closes, shortcode properties are removed, etc.
|
||||
*/
|
||||
unsetPlayer : function() {
|
||||
if ( this.player ) {
|
||||
unsetPlayers : function() {
|
||||
if ( this.players && this.players.length ) {
|
||||
wp.media.mixin.pauseAllPlayers();
|
||||
wp.media.mixin.removePlayer( this.player );
|
||||
this.player = false;
|
||||
_.each( this.players, function (player) {
|
||||
wp.media.mixin.removePlayer( player );
|
||||
} );
|
||||
this.players = [];
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -705,10 +707,10 @@
|
||||
media.view.MediaDetails = media.view.Settings.AttachmentDisplay.extend({
|
||||
initialize: function() {
|
||||
_.bindAll(this, 'success');
|
||||
|
||||
this.listenTo( this.controller, 'close', media.mixin.unsetPlayer );
|
||||
this.players = [];
|
||||
this.listenTo( this.controller, 'close', media.mixin.unsetPlayers );
|
||||
this.on( 'ready', this.setPlayer );
|
||||
this.on( 'media:setting:remove', media.mixin.unsetPlayer, this );
|
||||
this.on( 'media:setting:remove', media.mixin.unsetPlayers, this );
|
||||
this.on( 'media:setting:remove', this.render );
|
||||
this.on( 'media:setting:remove', this.setPlayer );
|
||||
this.events = _.extend( this.events, {
|
||||
@@ -764,8 +766,8 @@
|
||||
* @global MediaElementPlayer
|
||||
*/
|
||||
setPlayer : function() {
|
||||
if ( ! this.player && this.media ) {
|
||||
this.player = new MediaElementPlayer( this.media, this.settings );
|
||||
if ( ! this.players.length && this.media ) {
|
||||
this.players.push( new MediaElementPlayer( this.media, this.settings ) );
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
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
@@ -2175,7 +2175,7 @@
|
||||
library: options.selection,
|
||||
editing: options.editing,
|
||||
menu: 'video-playlist',
|
||||
dragInfoText: l10n.playlistDragInfo,
|
||||
dragInfoText: l10n.videoPlaylistDragInfo,
|
||||
dragInfo: false
|
||||
}),
|
||||
|
||||
@@ -3270,6 +3270,7 @@
|
||||
localDrag: false,
|
||||
overContainer: false,
|
||||
overDropzone: false,
|
||||
draggingFile: null,
|
||||
|
||||
initialize: function() {
|
||||
var self = this;
|
||||
@@ -3309,6 +3310,21 @@
|
||||
return supports;
|
||||
},
|
||||
|
||||
isDraggingFile: function( event ) {
|
||||
if ( this.draggingFile !== null ) {
|
||||
return this.draggingFile;
|
||||
}
|
||||
|
||||
if ( _.isUndefined( event.originalEvent ) || _.isUndefined( event.originalEvent.dataTransfer ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.draggingFile = _.indexOf( event.originalEvent.dataTransfer.types, 'Files' ) > -1 &&
|
||||
_.indexOf( event.originalEvent.dataTransfer.types, 'text/plain' ) === -1;
|
||||
|
||||
return this.draggingFile;
|
||||
},
|
||||
|
||||
refresh: function( e ) {
|
||||
var dropzone_id;
|
||||
for ( dropzone_id in this.dropzones ) {
|
||||
@@ -3320,6 +3336,10 @@
|
||||
$( e.target ).closest( '.uploader-editor' ).toggleClass( 'droppable', this.overDropzone );
|
||||
}
|
||||
|
||||
if ( ! this.overContainer && ! this.overDropzone ) {
|
||||
this.draggingFile = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -3383,8 +3403,8 @@
|
||||
return this;
|
||||
},
|
||||
|
||||
containerDragover: function() {
|
||||
if ( this.localDrag ) {
|
||||
containerDragover: function( event ) {
|
||||
if ( this.localDrag || ! this.isDraggingFile( event ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3399,13 +3419,13 @@
|
||||
_.delay( _.bind( this.refresh, this ), 50 );
|
||||
},
|
||||
|
||||
dropzoneDragover: function( e ) {
|
||||
if ( this.localDrag ) {
|
||||
dropzoneDragover: function( event ) {
|
||||
if ( this.localDrag || ! this.isDraggingFile( event ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.overDropzone = true;
|
||||
this.refresh( e );
|
||||
this.refresh( event );
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
4
wp-includes/js/media-views.min.js
vendored
4
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -28,6 +28,10 @@
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings .checkbox-setting span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings {
|
||||
padding-top: 0;
|
||||
top: 28px;
|
||||
@@ -50,8 +54,8 @@
|
||||
}
|
||||
|
||||
.media-embed-details .embed-media-settings .checkbox-setting {
|
||||
width: 100px;
|
||||
clear: none;
|
||||
float: none;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.video-details .wp-video-holder {
|
||||
@@ -98,6 +102,7 @@
|
||||
}
|
||||
|
||||
.wp-playlist-caption {
|
||||
display: block;
|
||||
max-width: 88%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -109,6 +114,8 @@
|
||||
.wp-playlist-item .wp-playlist-caption {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
max-width: -webkit-calc(100% - 40px);
|
||||
max-width: calc(100% - 40px);
|
||||
}
|
||||
|
||||
.wp-playlist-item-meta {
|
||||
@@ -142,6 +149,11 @@
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.rtl .wp-playlist-item-length {
|
||||
left: 3px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.wp-playlist-tracks {
|
||||
margin-top: 10px;
|
||||
}
|
||||
@@ -195,9 +207,19 @@
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.rtl .wp-playlist .wp-playlist-current-item img {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wp-playlist-current-item .wp-playlist-item-title,
|
||||
.wp-playlist-current-item .wp-playlist-item-artist {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wp-audio-playlist .me-cannotplay span {
|
||||
padding: 5px 15px;
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
initialize : function (options) {
|
||||
this.index = 0;
|
||||
this.settings = {};
|
||||
this.compatMode = $( 'body' ).hasClass( 'wp-admin' ) && $( '#content_ifr' ).length;
|
||||
this.data = options.metadata || $.parseJSON( this.$('script').html() );
|
||||
this.playerNode = this.$( this.data.type );
|
||||
|
||||
@@ -26,7 +27,9 @@
|
||||
this.renderTracks();
|
||||
}
|
||||
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
if ( this.isCompatibleSrc() ) {
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
}
|
||||
|
||||
_.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' );
|
||||
|
||||
@@ -38,40 +41,64 @@
|
||||
},
|
||||
|
||||
bindPlayer : function (mejs) {
|
||||
this.player = mejs;
|
||||
this.player.addEventListener( 'ended', this.ended );
|
||||
this.mejs = mejs;
|
||||
this.mejs.addEventListener( 'ended', this.ended );
|
||||
},
|
||||
|
||||
bindResetPlayer : function (mejs) {
|
||||
this.bindPlayer( mejs );
|
||||
this.playCurrentSrc();
|
||||
if ( this.isCompatibleSrc() ) {
|
||||
this.playCurrentSrc();
|
||||
}
|
||||
},
|
||||
|
||||
setPlayer: function () {
|
||||
if ( this._player ) {
|
||||
this._player.pause();
|
||||
this._player.remove();
|
||||
isCompatibleSrc: function () {
|
||||
var testNode;
|
||||
|
||||
if ( this.compatMode ) {
|
||||
testNode = $( '<span><source type="' + this.current.get( 'type' ) + '" /></span>' );
|
||||
|
||||
if ( ! wp.media.mixin.isCompatible( testNode ) ) {
|
||||
this.playerNode.removeAttr( 'src' );
|
||||
this.playerNode.removeAttr( 'poster' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
setPlayer: function (force) {
|
||||
if ( this.player ) {
|
||||
this.player.pause();
|
||||
this.player.remove();
|
||||
this.playerNode = this.$( this.data.type );
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
}
|
||||
|
||||
if (force) {
|
||||
if ( this.isCompatibleSrc() ) {
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
}
|
||||
this.settings.success = this.bindResetPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is also our bridge to the outside world
|
||||
*/
|
||||
this._player = new MediaElementPlayer( this.playerNode.get(0), this.settings );
|
||||
this.player = new MediaElementPlayer( this.playerNode.get(0), this.settings );
|
||||
},
|
||||
|
||||
playCurrentSrc : function () {
|
||||
this.renderCurrent();
|
||||
this.player.setSrc( this.playerNode.attr( 'src' ) );
|
||||
this.player.load();
|
||||
this.player.play();
|
||||
this.mejs.setSrc( this.playerNode.attr( 'src' ) );
|
||||
this.mejs.load();
|
||||
this.mejs.play();
|
||||
},
|
||||
|
||||
renderCurrent : function () {
|
||||
var dimensions;
|
||||
var dimensions, defaultImage = 'wp-includes/images/media/video.png';
|
||||
if ( 'video' === this.data.type ) {
|
||||
if ( this.data.images && this.current.get( 'image' ) ) {
|
||||
if ( this.data.images && this.current.get( 'image' ) && -1 === this.current.get( 'image' ).src.indexOf( defaultImage ) ) {
|
||||
this.playerNode.attr( 'poster', this.current.get( 'image' ).src );
|
||||
}
|
||||
dimensions = this.current.get( 'dimensions' ).resized;
|
||||
@@ -134,14 +161,14 @@
|
||||
},
|
||||
|
||||
loadCurrent : function () {
|
||||
var last = this.playerNode.attr( 'src' ).split('.').pop(),
|
||||
var last = this.playerNode.attr( 'src' ) && this.playerNode.attr( 'src' ).split('.').pop(),
|
||||
current = this.current.get( 'src' ).split('.').pop();
|
||||
|
||||
this.player.pause();
|
||||
this.mejs && this.mejs.pause();
|
||||
|
||||
if ( last !== current ) {
|
||||
this.setPlayer();
|
||||
} else {
|
||||
this.setPlayer( true );
|
||||
} else if ( this.isCompatibleSrc() ) {
|
||||
this.playerNode.attr( 'src', this.current.get( 'src' ) );
|
||||
this.playCurrentSrc();
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -37,13 +37,13 @@ window.wp = window.wp || {};
|
||||
// If we matched a leading `[`, strip it from the match
|
||||
// and increment the index accordingly.
|
||||
if ( match[1] ) {
|
||||
result.match = result.match.slice( 1 );
|
||||
result.content = result.content.slice( 1 );
|
||||
result.index++;
|
||||
}
|
||||
|
||||
// If we matched a trailing `]`, strip it from the match.
|
||||
if ( match[7] ) {
|
||||
result.match = result.match.slice( 0, -1 );
|
||||
result.content = result.content.slice( 0, -1 );
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
2
wp-includes/js/shortcode.min.js
vendored
2
wp-includes/js/shortcode.min.js
vendored
@@ -1 +1 @@
|
||||
window.wp=window.wp||{},function(){wp.shortcode={next:function(a,b,c){var d,e,f=wp.shortcode.regexp(a);return f.lastIndex=c||0,(d=f.exec(b))?"["===d[1]&&"]"===d[7]?wp.shortcode.next(a,b,f.lastIndex):(e={index:d.index,content:d[0],shortcode:wp.shortcode.fromMatch(d)},d[1]&&(e.match=e.match.slice(1),e.index++),d[7]&&(e.match=e.match.slice(0,-1)),e):void 0},replace:function(a,b,c){return b.replace(wp.shortcode.regexp(a),function(a,b,d,e,f,g,h,i){if("["===b&&"]"===i)return a;var j=c(wp.shortcode.fromMatch(arguments));return j?b+j+i:a})},string:function(a){return new wp.shortcode(a).string()},regexp:_.memoize(function(a){return new RegExp("\\[(\\[?)("+a+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}),attrs:_.memoize(function(a){var b,c,d={},e=[];for(b=/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/g,a=a.replace(/[\u00a0\u200b]/g," ");c=b.exec(a);)c[1]?d[c[1].toLowerCase()]=c[2]:c[3]?d[c[3].toLowerCase()]=c[4]:c[5]?d[c[5].toLowerCase()]=c[6]:c[7]?e.push(c[7]):c[8]&&e.push(c[8]);return{named:d,numeric:e}}),fromMatch:function(a){var b;return b=a[4]?"self-closing":a[6]?"closed":"single",new wp.shortcode({tag:a[2],attrs:a[3],type:b,content:a[5]})}},wp.shortcode=_.extend(function(a){_.extend(this,_.pick(a||{},"tag","attrs","type","content"));var b=this.attrs;this.attrs={named:{},numeric:[]},b&&(_.isString(b)?this.attrs=wp.shortcode.attrs(b):_.isEqual(_.keys(b),["named","numeric"])?this.attrs=b:_.each(a.attrs,function(a,b){this.set(b,a)},this))},wp.shortcode),_.extend(wp.shortcode.prototype,{get:function(a){return this.attrs[_.isNumber(a)?"numeric":"named"][a]},set:function(a,b){return this.attrs[_.isNumber(a)?"numeric":"named"][a]=b,this},string:function(){var a="["+this.tag;return _.each(this.attrs.numeric,function(b){a+=/\s/.test(b)?' "'+b+'"':" "+b}),_.each(this.attrs.named,function(b,c){a+=" "+c+'="'+b+'"'}),"single"===this.type?a+"]":"self-closing"===this.type?a+" /]":(a+="]",this.content&&(a+=this.content),a+"[/"+this.tag+"]")}})}(),function(){wp.html=_.extend(wp.html||{},{attrs:function(a){var b,c;return"/"===a[a.length-1]&&(a=a.slice(0,-1)),b=wp.shortcode.attrs(a),c=b.named,_.each(b.numeric,function(a){/\s/.test(a)||(c[a]="")}),c},string:function(a){var b="<"+a.tag,c=a.content||"";return _.each(a.attrs,function(a,c){b+=" "+c,""!==a&&(_.isBoolean(a)&&(a=a?"true":"false"),b+='="'+a+'"')}),a.single?b+" />":(b+=">",b+=_.isObject(c)?wp.html.string(c):c,b+"</"+a.tag+">")}})}();
|
||||
window.wp=window.wp||{},function(){wp.shortcode={next:function(a,b,c){var d,e,f=wp.shortcode.regexp(a);return f.lastIndex=c||0,(d=f.exec(b))?"["===d[1]&&"]"===d[7]?wp.shortcode.next(a,b,f.lastIndex):(e={index:d.index,content:d[0],shortcode:wp.shortcode.fromMatch(d)},d[1]&&(e.content=e.content.slice(1),e.index++),d[7]&&(e.content=e.content.slice(0,-1)),e):void 0},replace:function(a,b,c){return b.replace(wp.shortcode.regexp(a),function(a,b,d,e,f,g,h,i){if("["===b&&"]"===i)return a;var j=c(wp.shortcode.fromMatch(arguments));return j?b+j+i:a})},string:function(a){return new wp.shortcode(a).string()},regexp:_.memoize(function(a){return new RegExp("\\[(\\[?)("+a+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}),attrs:_.memoize(function(a){var b,c,d={},e=[];for(b=/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/g,a=a.replace(/[\u00a0\u200b]/g," ");c=b.exec(a);)c[1]?d[c[1].toLowerCase()]=c[2]:c[3]?d[c[3].toLowerCase()]=c[4]:c[5]?d[c[5].toLowerCase()]=c[6]:c[7]?e.push(c[7]):c[8]&&e.push(c[8]);return{named:d,numeric:e}}),fromMatch:function(a){var b;return b=a[4]?"self-closing":a[6]?"closed":"single",new wp.shortcode({tag:a[2],attrs:a[3],type:b,content:a[5]})}},wp.shortcode=_.extend(function(a){_.extend(this,_.pick(a||{},"tag","attrs","type","content"));var b=this.attrs;this.attrs={named:{},numeric:[]},b&&(_.isString(b)?this.attrs=wp.shortcode.attrs(b):_.isEqual(_.keys(b),["named","numeric"])?this.attrs=b:_.each(a.attrs,function(a,b){this.set(b,a)},this))},wp.shortcode),_.extend(wp.shortcode.prototype,{get:function(a){return this.attrs[_.isNumber(a)?"numeric":"named"][a]},set:function(a,b){return this.attrs[_.isNumber(a)?"numeric":"named"][a]=b,this},string:function(){var a="["+this.tag;return _.each(this.attrs.numeric,function(b){a+=/\s/.test(b)?' "'+b+'"':" "+b}),_.each(this.attrs.named,function(b,c){a+=" "+c+'="'+b+'"'}),"single"===this.type?a+"]":"self-closing"===this.type?a+" /]":(a+="]",this.content&&(a+=this.content),a+"[/"+this.tag+"]")}})}(),function(){wp.html=_.extend(wp.html||{},{attrs:function(a){var b,c;return"/"===a[a.length-1]&&(a=a.slice(0,-1)),b=wp.shortcode.attrs(a),c=b.named,_.each(b.numeric,function(a){/\s/.test(a)||(c[a]="")}),c},string:function(a){var b="<"+a.tag,c=a.content||"";return _.each(a.attrs,function(a,c){b+=" "+c,""!==a&&(_.isBoolean(a)&&(a=a?"true":"false"),b+='="'+a+'"')}),a.single?b+" />":(b+=">",b+=_.isObject(c)?wp.html.string(c):c,b+"</"+a.tag+">")}})}();
|
||||
@@ -63,7 +63,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
|
||||
// Hide the toolbars after loading
|
||||
editor.on( 'PostRender', function() {
|
||||
if ( getUserSetting('hidetb', '0') === '0' ) {
|
||||
if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) {
|
||||
toggleToolbars( 'hide' );
|
||||
}
|
||||
});
|
||||
@@ -91,6 +91,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
'<img src="' + tinymce.Env.transparentSrc + '" class="wp-more-tag mce-wp-nextpage" ' +
|
||||
'title="Page break" data-mce-resize="false" data-mce-placeholder="1" />' );
|
||||
}
|
||||
|
||||
if ( e.content.indexOf( '<?"' ) !== -1 ) {
|
||||
e.content = e.content.replace( /<\?"/g, '' );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -317,7 +321,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
dom.bind( doc, 'dragstart dragend dragover drop', function( event ) {
|
||||
if ( typeof window.jQuery !== 'undefined' ) {
|
||||
// Trigger the jQuery handlers.
|
||||
window.jQuery( document ).triggerHandler( event.type );
|
||||
window.jQuery( document ).trigger( new window.jQuery.Event( event ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
/* global tinymce */
|
||||
tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
var toolbarActive = false;
|
||||
var serializer,
|
||||
toolbarActive = false;
|
||||
|
||||
function parseShortcode( content ) {
|
||||
return content.replace( /(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?/g, function( a, b, c ) {
|
||||
@@ -208,6 +209,19 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
return node && !! ( node.textContent || node.innerText );
|
||||
}
|
||||
|
||||
// Verify HTML in captions
|
||||
function verifyHTML( caption ) {
|
||||
if ( ! caption || ( caption.indexOf( '<' ) === -1 && caption.indexOf( '>' ) === -1 ) ) {
|
||||
return caption;
|
||||
}
|
||||
|
||||
if ( ! serializer ) {
|
||||
serializer = new tinymce.html.Serializer( {}, editor.schema );
|
||||
}
|
||||
|
||||
return serializer.serialize( editor.parser.parse( caption, { forced_root_block: false } ) );
|
||||
}
|
||||
|
||||
function updateImage( imageNode, imageData ) {
|
||||
var classes, className, node, html, parent, wrap, linkNode,
|
||||
captionNode, dd, dl, id, attrs, linkAttrs, width, height,
|
||||
@@ -285,6 +299,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
}
|
||||
|
||||
if ( imageData.caption ) {
|
||||
imageData.caption = verifyHTML( imageData.caption );
|
||||
|
||||
id = imageData.attachment_id ? 'attachment_' + imageData.attachment_id : null;
|
||||
className = 'wp-caption align' + ( imageData.align || 'none' );
|
||||
@@ -320,7 +335,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
|
||||
if ( parent = dom.getParent( node, 'p' ) ) {
|
||||
wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
|
||||
dom.insertAfter( wrap, parent );
|
||||
parent.parentNode.insertBefore( wrap, parent );
|
||||
dom.remove( node );
|
||||
|
||||
if ( dom.isEmpty( parent ) ) {
|
||||
@@ -563,6 +578,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
|
||||
// Convert remaining line breaks to <br>
|
||||
caption = caption.replace( /(<br[^>]*>)\s*\n\s*/g, '$1' ).replace( /\s*\n\s*/g, '<br />' );
|
||||
caption = verifyHTML( caption );
|
||||
}
|
||||
|
||||
if ( ! imgNode ) {
|
||||
@@ -593,7 +609,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
|
||||
if ( parent && parent.nodeName === 'P' ) {
|
||||
wrap = dom.create( 'div', { 'class': 'mceTemp' }, html );
|
||||
dom.insertAfter( wrap, parent );
|
||||
parent.parentNode.insertBefore( wrap, parent );
|
||||
editor.selection.select( wrap );
|
||||
editor.nodeChanged();
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -15,8 +15,10 @@ tinymce.PluginManager.add( 'wplink', function( editor ) {
|
||||
editor.addShortcut( 'ctrl+k', '', 'WP_Link' );
|
||||
|
||||
function setState( button, node ) {
|
||||
button.disabled( editor.selection.isCollapsed() && node.nodeName !== 'A' );
|
||||
button.active( node.nodeName === 'A' && ! node.name );
|
||||
var parent = editor.dom.getParent( node, 'a' );
|
||||
|
||||
button.disabled( ( editor.selection.isCollapsed() && ! parent ) || ( parent && ! parent.href ) );
|
||||
button.active( parent && parent.href );
|
||||
}
|
||||
|
||||
editor.addButton( 'link', {
|
||||
|
||||
@@ -1 +1 @@
|
||||
tinymce.PluginManager.add("wplink",function(a){function b(b,c){b.disabled(a.selection.isCollapsed()&&"A"!==c.nodeName),b.active("A"===c.nodeName&&!c.name)}var c;a.addCommand("WP_Link",function(){c&&c.disabled()||"undefined"==typeof window.wpLink||window.wpLink.open(a.id)}),a.addShortcut("alt+shift+a","","WP_Link"),a.addShortcut("ctrl+k","","WP_Link"),a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Alt+Shift+A",cmd:"WP_Link",onPostRender:function(){c=this,a.on("nodechange",function(a){b(c,a.element)})}}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",onPostRender:function(){var c=this;a.on("nodechange",function(a){b(c,a.element)})}}),a.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Alt+Shift+A",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0})});
|
||||
tinymce.PluginManager.add("wplink",function(a){function b(b,c){var d=a.dom.getParent(c,"a");b.disabled(a.selection.isCollapsed()&&!d||d&&!d.href),b.active(d&&d.href)}var c;a.addCommand("WP_Link",function(){c&&c.disabled()||"undefined"==typeof window.wpLink||window.wpLink.open(a.id)}),a.addShortcut("alt+shift+a","","WP_Link"),a.addShortcut("ctrl+k","","WP_Link"),a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Alt+Shift+A",cmd:"WP_Link",onPostRender:function(){c=this,a.on("nodechange",function(a){b(c,a.element)})}}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",onPostRender:function(){var c=this;a.on("nodechange",function(a){b(c,a.element)})}}),a.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Alt+Shift+A",cmd:"WP_Link",stateSelector:"a[href]",context:"insert",prependToContext:!0})});
|
||||
@@ -332,17 +332,24 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
tinymce.each( dom.select( 'div[data-wpview-text]', event.node ), function( node ) {
|
||||
// Empty the wrap node
|
||||
if ( 'textContent' in node ) {
|
||||
node.textContent = '';
|
||||
node.textContent = '\u00a0';
|
||||
} else {
|
||||
node.innerText = '';
|
||||
node.innerText = '\u00a0';
|
||||
}
|
||||
|
||||
// This makes all views into block tags (as we use <div>).
|
||||
// Can use 'PostProcess' and a regex instead.
|
||||
dom.replace( dom.create( 'p', null, window.decodeURIComponent( dom.getAttrib( node, 'data-wpview-text' ) ) ), node );
|
||||
});
|
||||
});
|
||||
|
||||
editor.on( 'PostProcess', function( event ) {
|
||||
if ( event.content ) {
|
||||
event.content = event.content.replace( /<div [^>]*?data-wpview-text="([^"]*)"[^>]*>[\s\S]*?<\/div>/g, function( match, shortcode ) {
|
||||
if ( shortcode ) {
|
||||
return '<p>' + window.decodeURIComponent( shortcode ) + '</p>';
|
||||
}
|
||||
return ''; // If error, remove the view wrapper
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
editor.on( 'keydown', function( event ) {
|
||||
var keyCode = event.keyCode,
|
||||
body = editor.getBody(),
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -489,6 +489,82 @@ function wp_kses( $string, $allowed_html, $allowed_protocols = array() ) {
|
||||
return wp_kses_split($string, $allowed_html, $allowed_protocols);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters one attribute only and ensures its value is allowed.
|
||||
*
|
||||
* This function has the advantage of being more secure than esc_attr() and can
|
||||
* escape data in some situations where wp_kses() must strip the whole attribute.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $string The 'whole' attribute, including name and value.
|
||||
* @param string $element The element name to which the attribute belongs.
|
||||
* @return string Filtered attribute.
|
||||
*/
|
||||
function wp_kses_one_attr( $string, $element ) {
|
||||
$uris = array('xmlns', 'profile', 'href', 'src', 'cite', 'classid', 'codebase', 'data', 'usemap', 'longdesc', 'action');
|
||||
$allowed_html = wp_kses_allowed_html( 'post' );
|
||||
$allowed_protocols = wp_allowed_protocols();
|
||||
$string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
|
||||
$string = wp_kses_js_entities( $string );
|
||||
$string = wp_kses_normalize_entities( $string );
|
||||
|
||||
// Preserve leading and trailing whitespace.
|
||||
$matches = array();
|
||||
preg_match('/^\s*/', $string, $matches);
|
||||
$lead = $matches[0];
|
||||
preg_match('/\s*$/', $string, $matches);
|
||||
$trail = $matches[0];
|
||||
if ( empty( $trail ) ) {
|
||||
$string = substr( $string, strlen( $lead ) );
|
||||
} else {
|
||||
$string = substr( $string, strlen( $lead ), -strlen( $trail ) );
|
||||
}
|
||||
|
||||
// Parse attribute name and value from input.
|
||||
$split = preg_split( '/\s*=\s*/', $string, 2 );
|
||||
$name = $split[0];
|
||||
if ( count( $split ) == 2 ) {
|
||||
$value = $split[1];
|
||||
|
||||
// Remove quotes surrounding $value.
|
||||
// Also guarantee correct quoting in $string for this one attribute.
|
||||
if ( '' == $value ) {
|
||||
$quote = '';
|
||||
} else {
|
||||
$quote = $value[0];
|
||||
}
|
||||
if ( '"' == $quote || "'" == $quote ) {
|
||||
if ( substr( $value, -1 ) != $quote ) {
|
||||
return '';
|
||||
}
|
||||
$value = substr( $value, 1, -1 );
|
||||
} else {
|
||||
$quote = '"';
|
||||
}
|
||||
|
||||
// Sanitize quotes and angle braces.
|
||||
$value = htmlspecialchars( $value, ENT_QUOTES, null, false );
|
||||
|
||||
// Sanitize URI values.
|
||||
if ( in_array( strtolower( $name ), $uris ) ) {
|
||||
$value = wp_kses_bad_protocol( $value, $allowed_protocols );
|
||||
}
|
||||
|
||||
$string = "$name=$quote$value$quote";
|
||||
$vless = 'n';
|
||||
} else {
|
||||
$value = '';
|
||||
$vless = 'y';
|
||||
}
|
||||
|
||||
// Sanitize attribute by name.
|
||||
wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html );
|
||||
|
||||
// Restore whitespace.
|
||||
return $lead . $string . $trail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of allowed tags and attributes for a given context.
|
||||
*
|
||||
@@ -710,45 +786,11 @@ function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
|
||||
# Go through $attrarr, and save the allowed attributes for this element
|
||||
# in $attr2
|
||||
$attr2 = '';
|
||||
|
||||
$allowed_attr = $allowed_html[strtolower($element)];
|
||||
foreach ($attrarr as $arreach) {
|
||||
if ( ! isset( $allowed_attr[strtolower($arreach['name'])] ) )
|
||||
continue; # the attribute is not allowed
|
||||
|
||||
$current = $allowed_attr[strtolower($arreach['name'])];
|
||||
if ( $current == '' )
|
||||
continue; # the attribute is not allowed
|
||||
|
||||
if ( strtolower( $arreach['name'] ) == 'style' ) {
|
||||
$orig_value = $arreach['value'];
|
||||
$value = safecss_filter_attr( $orig_value );
|
||||
|
||||
if ( empty( $value ) )
|
||||
continue;
|
||||
|
||||
$arreach['value'] = $value;
|
||||
$arreach['whole'] = str_replace( $orig_value, $value, $arreach['whole'] );
|
||||
}
|
||||
|
||||
if ( ! is_array($current) ) {
|
||||
foreach ( $attrarr as $arreach ) {
|
||||
if ( wp_kses_attr_check( $arreach['name'], $arreach['value'], $arreach['whole'], $arreach['vless'], $element, $allowed_html ) ) {
|
||||
$attr2 .= ' '.$arreach['whole'];
|
||||
# there are no checks
|
||||
|
||||
} else {
|
||||
# there are some checks
|
||||
$ok = true;
|
||||
foreach ($current as $currkey => $currval) {
|
||||
if ( ! wp_kses_check_attr_val($arreach['value'], $arreach['vless'], $currkey, $currval) ) {
|
||||
$ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $ok )
|
||||
$attr2 .= ' '.$arreach['whole']; # it passed them
|
||||
} # if !is_array($current)
|
||||
} # foreach
|
||||
}
|
||||
}
|
||||
|
||||
# Remove any "<" or ">" characters
|
||||
$attr2 = preg_replace('/[<>]/', '', $attr2);
|
||||
@@ -756,6 +798,53 @@ function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) {
|
||||
return "<$element$attr2$xhtml_slash>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether an attribute is allowed.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $name The attribute name. Returns empty string when not allowed.
|
||||
* @param string $value The attribute value. Returns a filtered value.
|
||||
* @param string $whole The name=value input. Returns filtered input.
|
||||
* @param string $vless 'y' when attribute like "enabled", otherwise 'n'.
|
||||
* @param string $element The name of the element to which this attribute belongs.
|
||||
* @param array $allowed_html The full list of allowed elements and attributes.
|
||||
* @return bool Is the attribute allowed?
|
||||
*/
|
||||
function wp_kses_attr_check( &$name, &$value, &$whole, $vless, $element, $allowed_html ) {
|
||||
$allowed_attr = $allowed_html[strtolower( $element )];
|
||||
|
||||
$name_low = strtolower( $name );
|
||||
if ( ! isset( $allowed_attr[$name_low] ) || '' == $allowed_attr[$name_low] ) {
|
||||
$name = $value = $whole = '';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( 'style' == $name_low ) {
|
||||
$new_value = safecss_filter_attr( $value );
|
||||
|
||||
if ( empty( $new_value ) ) {
|
||||
$name = $value = $whole = '';
|
||||
return false;
|
||||
}
|
||||
|
||||
$whole = str_replace( $value, $new_value, $whole );
|
||||
$value = $new_value;
|
||||
}
|
||||
|
||||
if ( is_array( $allowed_attr[$name_low] ) ) {
|
||||
// there are some checks
|
||||
foreach ( $allowed_attr[$name_low] as $currkey => $currval ) {
|
||||
if ( ! wp_kses_check_attr_val( $value, $vless, $currkey, $currval ) ) {
|
||||
$name = $value = $whole = '';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds an attribute list from string containing attributes.
|
||||
*
|
||||
@@ -885,6 +974,109 @@ function wp_kses_hair($attr, $allowed_protocols) {
|
||||
return $attrarr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all attributes of an HTML element.
|
||||
*
|
||||
* Does not modify input. May return "evil" output.
|
||||
*
|
||||
* Based on wp_kses_split2() and wp_kses_attr()
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $element HTML element/tag
|
||||
* @return array|bool List of attributes found in $element. Returns false on failure.
|
||||
*/
|
||||
function wp_kses_attr_parse( $element ) {
|
||||
$valid = preg_match('%^(<\s*)(/\s*)?([a-zA-Z0-9]+\s*)([^>]*)(>?)$%', $element, $matches);
|
||||
if ( 1 !== $valid ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$begin = $matches[1];
|
||||
$slash = $matches[2];
|
||||
$elname = $matches[3];
|
||||
$attr = $matches[4];
|
||||
$end = $matches[5];
|
||||
|
||||
if ( '' !== $slash ) {
|
||||
// Closing elements do not get parsed.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is there a closing XHTML slash at the end of the attributes?
|
||||
if ( 1 === preg_match( '%\s*/\s*$%', $attr, $matches ) ) {
|
||||
$xhtml_slash = $matches[0];
|
||||
$attr = substr( $attr, 0, -strlen( $xhtml_slash ) );
|
||||
} else {
|
||||
$xhtml_slash = '';
|
||||
}
|
||||
|
||||
// Split it
|
||||
$attrarr = wp_kses_hair_parse( $attr );
|
||||
if ( false === $attrarr ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure all input is returned by adding front and back matter.
|
||||
array_unshift( $attrarr, $begin . $slash . $elname );
|
||||
array_push( $attrarr, $xhtml_slash . $end );
|
||||
|
||||
return $attrarr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds an attribute list from string containing attributes.
|
||||
*
|
||||
* Does not modify input. May return "evil" output.
|
||||
* In case of unexpected input, returns false instead of stripping things.
|
||||
*
|
||||
* Based on wp_kses_hair() but does not return a multi-dimensional array.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $attr Attribute list from HTML element to closing HTML element tag
|
||||
* @return array|bool List of attributes found in $attr. Returns false on failure.
|
||||
*/
|
||||
function wp_kses_hair_parse( $attr ) {
|
||||
if ( '' === $attr ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$regex =
|
||||
'(?:'
|
||||
. '[-a-zA-Z:]+' // Attribute name.
|
||||
. '|'
|
||||
. '\[\[?[^\[\]]+\]\]?' // Shortcode in the name position implies unfiltered_html.
|
||||
. ')'
|
||||
. '(?:' // Attribute value.
|
||||
. '\s*=\s*' // All values begin with '='
|
||||
. '(?:'
|
||||
. '"[^"]*"' // Double-quoted
|
||||
. '|'
|
||||
. "'[^']*'" // Single-quoted
|
||||
. '|'
|
||||
. '[^\s"\']+' // Non-quoted
|
||||
. '(?:\s|$)' // Must have a space
|
||||
. ')'
|
||||
. '|'
|
||||
. '(?:\s|$)' // If attribute has no value, space is required.
|
||||
. ')'
|
||||
. '\s*'; // Trailing space is optional except as mentioned above.
|
||||
|
||||
// Although it is possible to reduce this procedure to a single regexp,
|
||||
// we must run that regexp twice to get exactly the expected result.
|
||||
|
||||
$validation = "%^($regex)+$%";
|
||||
$extraction = "%$regex%";
|
||||
|
||||
if ( 1 === preg_match( $validation, $attr ) ) {
|
||||
preg_match_all( $extraction, $attr, $attrarr );
|
||||
return $attrarr[0];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs different checks for attribute values.
|
||||
*
|
||||
@@ -1434,7 +1626,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
|
||||
$css = wp_kses_no_null($css);
|
||||
$css = str_replace(array("\n","\r","\t"), '', $css);
|
||||
|
||||
if ( preg_match( '%[\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments
|
||||
if ( preg_match( '%[\\\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments
|
||||
return '';
|
||||
|
||||
$css_array = explode( ';', trim( $css ) );
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
function wp_underscore_audio_template() {
|
||||
$audio_types = wp_get_audio_extensions();
|
||||
?>
|
||||
<audio controls
|
||||
<audio style="visibility: hidden"
|
||||
controls
|
||||
class="wp-audio-shortcode"
|
||||
width="{{ _.isUndefined( data.model.width ) ? 400 : data.model.width }}"
|
||||
preload="{{ _.isUndefined( data.model.preload ) ? 'none' : data.model.preload }}"
|
||||
@@ -853,15 +854,14 @@ function wp_print_media_templates() {
|
||||
</div>
|
||||
|
||||
<label class="setting checkbox-setting">
|
||||
<span><?php _e( 'Autoplay' ); ?></span>
|
||||
<input type="checkbox" data-setting="autoplay" />
|
||||
<span><?php _e( 'Autoplay' ); ?></span>
|
||||
</label>
|
||||
|
||||
<label class="setting checkbox-setting">
|
||||
<span><?php _e( 'Loop' ); ?></span>
|
||||
<input type="checkbox" data-setting="loop" />
|
||||
<span><?php _e( 'Loop' ); ?></span>
|
||||
</label>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
@@ -944,15 +944,14 @@ function wp_print_media_templates() {
|
||||
</div>
|
||||
|
||||
<label class="setting checkbox-setting">
|
||||
<span><?php _e( 'Autoplay' ); ?></span>
|
||||
<input type="checkbox" data-setting="autoplay" />
|
||||
<span><?php _e( 'Autoplay' ); ?></span>
|
||||
</label>
|
||||
|
||||
<label class="setting checkbox-setting">
|
||||
<span><?php _e( 'Loop' ); ?></span>
|
||||
<input type="checkbox" data-setting="loop" />
|
||||
<span><?php _e( 'Loop' ); ?></span>
|
||||
</label>
|
||||
<div class="clear"></div>
|
||||
|
||||
<label class="setting" data-setting="content">
|
||||
<span><?php _e( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)' ); ?></span>
|
||||
|
||||
@@ -801,6 +801,8 @@ function img_caption_shortcode( $attr, $content = null ) {
|
||||
$content = $matches[1];
|
||||
$attr['caption'] = trim( $matches[2] );
|
||||
}
|
||||
} elseif ( strpos( $attr['caption'], '<' ) !== false ) {
|
||||
$attr['caption'] = wp_kses( $attr['caption'], 'post' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1215,6 +1217,10 @@ function wp_playlist_shortcode( $attr ) {
|
||||
$orderby = 'none';
|
||||
}
|
||||
|
||||
if ( $atts['type'] !== 'audio' ) {
|
||||
$atts['type'] = 'video';
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'post_status' => 'inherit',
|
||||
'post_type' => 'attachment',
|
||||
@@ -1353,6 +1359,8 @@ function wp_playlist_shortcode( $attr ) {
|
||||
echo (int) $theme_width;
|
||||
?>"<?php if ( 'video' === $safe_type ):
|
||||
echo ' height="', (int) $theme_height, '"';
|
||||
else:
|
||||
echo ' style="visibility: hidden"';
|
||||
endif; ?>></<?php echo $safe_type ?>>
|
||||
<div class="wp-playlist-next"></div>
|
||||
<div class="wp-playlist-prev"></div>
|
||||
@@ -1555,7 +1563,7 @@ function wp_audio_shortcode( $attr, $content = '' ) {
|
||||
'loop' => $loop,
|
||||
'autoplay' => $autoplay,
|
||||
'preload' => $preload,
|
||||
'style' => 'width: 100%',
|
||||
'style' => 'width: 100%; visibility: hidden;',
|
||||
);
|
||||
|
||||
// These ones should just be omitted altogether if they are blank
|
||||
@@ -2654,7 +2662,7 @@ function wp_enqueue_media( $args = array() ) {
|
||||
if ( did_action( 'wp_enqueue_media' ) )
|
||||
return;
|
||||
|
||||
global $content_width;
|
||||
global $content_width, $wpdb;
|
||||
|
||||
$defaults = array(
|
||||
'post' => null,
|
||||
@@ -2693,15 +2701,20 @@ function wp_enqueue_media( $args = array() ) {
|
||||
}
|
||||
}
|
||||
|
||||
$audio = $video = 0;
|
||||
$counts = (array) wp_count_attachments();
|
||||
foreach ( $counts as $mime => $total ) {
|
||||
if ( 0 === strpos( $mime, 'audio/' ) ) {
|
||||
$audio += (int) $total;
|
||||
} elseif ( 0 === strpos( $mime, 'video/' ) ) {
|
||||
$video += (int) $total;
|
||||
}
|
||||
}
|
||||
$has_audio = $wpdb->get_var( "
|
||||
SELECT ID
|
||||
FROM $wpdb->posts
|
||||
WHERE post_type = 'attachment'
|
||||
AND post_mime_type LIKE 'audio%'
|
||||
LIMIT 1
|
||||
" );
|
||||
$has_video = $wpdb->get_var( "
|
||||
SELECT ID
|
||||
FROM $wpdb->posts
|
||||
WHERE post_type = 'attachment'
|
||||
AND post_mime_type LIKE 'video%'
|
||||
LIMIT 1
|
||||
" );
|
||||
|
||||
$settings = array(
|
||||
'tabs' => $tabs,
|
||||
@@ -2717,8 +2730,8 @@ function wp_enqueue_media( $args = array() ) {
|
||||
),
|
||||
'defaultProps' => $props,
|
||||
'attachmentCounts' => array(
|
||||
'audio' => $audio,
|
||||
'video' => $video
|
||||
'audio' => (int) $has_audio,
|
||||
'video' => (int) $has_video,
|
||||
),
|
||||
'embedExts' => $exts,
|
||||
'embedMimes' => $ext_mimes,
|
||||
@@ -2829,7 +2842,7 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'videoReplaceTitle' => __( 'Replace Video' ),
|
||||
'videoAddSourceTitle' => __( 'Add Video Source' ),
|
||||
'videoDetailsCancel' => __( 'Cancel Edit' ),
|
||||
'videoSelectPosterImageTitle' => _( 'Select Poster Image' ),
|
||||
'videoSelectPosterImageTitle' => __( 'Select Poster Image' ),
|
||||
'videoAddTrackTitle' => __( 'Add Subtitles' ),
|
||||
|
||||
// Playlist
|
||||
|
||||
@@ -348,13 +348,30 @@ function get_site_by_path( $domain, $path, $segments = null ) {
|
||||
* then cache whether we can just always ignore paths.
|
||||
*/
|
||||
|
||||
// Either www or non-www is supported, not both. If a www domain is requested,
|
||||
// query for both to provide the proper redirect.
|
||||
$domains = array( $domain );
|
||||
if ( 'www.' === substr( $domain, 0, 4 ) ) {
|
||||
$domains[] = substr( $domain, 4 );
|
||||
$search_domains = "'" . implode( "', '", $wpdb->_escape( $domains ) ) . "'";
|
||||
}
|
||||
|
||||
if ( count( $paths ) > 1 ) {
|
||||
$paths = "'" . implode( "', '", $wpdb->_escape( $paths ) ) . "'";
|
||||
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $domain );
|
||||
$sql .= " AND path IN ($paths) ORDER BY CHAR_LENGTH(path) DESC LIMIT 1";
|
||||
$search_paths = "'" . implode( "', '", $wpdb->_escape( $paths ) ) . "'";
|
||||
}
|
||||
|
||||
if ( count( $domains ) > 1 && count( $paths ) > 1 ) {
|
||||
$site = $wpdb->get_row( "SELECT * FROM $wpdb->blogs WHERE domain IN ($search_domains) AND path IN ($search_paths) ORDER BY CHAR_LENGTH(domain) DESC, CHAR_LENGTH(path) DESC LIMIT 1" );
|
||||
} elseif ( count( $domains ) > 1 ) {
|
||||
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE path = %s", $paths[0] );
|
||||
$sql .= " AND domain IN ($search_domains) ORDER BY CHAR_LENGTH(domain) DESC LIMIT 1";
|
||||
$site = $wpdb->get_row( $sql );
|
||||
} elseif ( count( $paths ) > 1 ) {
|
||||
$sql = $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s", $domains[0] );
|
||||
$sql .= " AND path IN ($search_paths) ORDER BY CHAR_LENGTH(path) DESC LIMIT 1";
|
||||
$site = $wpdb->get_row( $sql );
|
||||
} else {
|
||||
$site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s and path = %s", $domain, $paths[0] ) );
|
||||
$site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $domains[0], $paths[0] ) );
|
||||
}
|
||||
|
||||
if ( $site ) {
|
||||
|
||||
@@ -35,7 +35,7 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||
$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
|
||||
}
|
||||
|
||||
$path = strtolower( stripslashes( $_SERVER['REQUEST_URI'] ) );
|
||||
$path = stripslashes( $_SERVER['REQUEST_URI'] );
|
||||
if ( is_admin() ) {
|
||||
$path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path );
|
||||
}
|
||||
@@ -53,9 +53,9 @@ if ( !isset( $current_site ) || !isset( $current_blog ) ) {
|
||||
$current_site->blog_id = BLOGID_CURRENT_SITE;
|
||||
}
|
||||
|
||||
if ( $current_site->domain === $domain && $current_site->path === $path ) {
|
||||
if ( 0 === strcasecmp( $current_site->domain, $domain ) && 0 === strcasecmp( $current_site->path, $path ) ) {
|
||||
$current_blog = get_site_by_path( $domain, $path );
|
||||
} elseif ( '/' !== $current_site->path && $current_site->domain === $domain && 0 === strpos( $path, $current_site->path ) ) {
|
||||
} elseif ( '/' !== $current_site->path && 0 === strcasecmp( $current_site->domain, $domain ) && 0 === stripos( $path, $current_site->path ) ) {
|
||||
// If the current network has a path and also matches the domain and path of the request,
|
||||
// we need to look for a site using the first path segment following the network's path.
|
||||
$current_blog = get_site_by_path( $domain, $path, 1 + count( explode( '/', trim( $current_site->path, '/' ) ) ) );
|
||||
|
||||
@@ -647,7 +647,7 @@ function wp_validate_auth_cookie($cookie = '', $scheme = '') {
|
||||
$key = wp_hash($username . $pass_frag . '|' . $expiration, $scheme);
|
||||
$hash = hash_hmac('md5', $username . '|' . $expiration, $key);
|
||||
|
||||
if ( hash_hmac( 'md5', $hmac, $key ) !== hash_hmac( 'md5', $hash, $key ) ) {
|
||||
if ( ! hash_equals( $hash, $hmac ) ) {
|
||||
/**
|
||||
* Fires if a bad authentication cookie hash is encountered.
|
||||
*
|
||||
@@ -1197,7 +1197,8 @@ function wp_validate_redirect($location, $default = '') {
|
||||
// In php 5 parse_url may fail if the URL query part contains http://, bug #38143
|
||||
$test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
|
||||
|
||||
$lp = parse_url($test);
|
||||
// @-operator is used to prevent possible warnings in PHP < 5.3.3.
|
||||
$lp = @parse_url($test);
|
||||
|
||||
// Give up if malformed URL
|
||||
if ( false === $lp )
|
||||
@@ -1207,9 +1208,17 @@ function wp_validate_redirect($location, $default = '') {
|
||||
if ( isset($lp['scheme']) && !('http' == $lp['scheme'] || 'https' == $lp['scheme']) )
|
||||
return $default;
|
||||
|
||||
// Reject if scheme is set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
|
||||
if ( isset($lp['scheme']) && !isset($lp['host']) )
|
||||
// Reject if certain components are set but host is not. This catches urls like https:host.com for which parse_url does not set the host field.
|
||||
if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
// Reject malformed components parse_url() can return on odd inputs.
|
||||
foreach ( array( 'user', 'pass', 'host' ) as $component ) {
|
||||
if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
$wpp = parse_url(home_url());
|
||||
|
||||
@@ -1658,11 +1667,17 @@ function wp_verify_nonce($nonce, $action = -1) {
|
||||
$i = wp_nonce_tick();
|
||||
|
||||
// Nonce generated 0-12 hours ago
|
||||
if ( substr(wp_hash($i . $action . $uid, 'nonce'), -12, 10) === $nonce )
|
||||
$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid, 'nonce'), -12, 10 );
|
||||
if ( hash_equals( $expected, $nonce ) ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Nonce generated 12-24 hours ago
|
||||
if ( substr(wp_hash(($i - 1) . $action . $uid, 'nonce'), -12, 10) === $nonce )
|
||||
$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid, 'nonce' ), -12, 10 );
|
||||
if ( hash_equals( $expected, $nonce ) ) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
// Invalid nonce
|
||||
return false;
|
||||
}
|
||||
@@ -1687,7 +1702,7 @@ function wp_create_nonce($action = -1) {
|
||||
|
||||
$i = wp_nonce_tick();
|
||||
|
||||
return substr(wp_hash($i . $action . $uid, 'nonce'), -12, 10);
|
||||
return substr(wp_hash($i . '|' . $action . '|' . $uid, 'nonce'), -12, 10);
|
||||
}
|
||||
endif;
|
||||
|
||||
@@ -1863,7 +1878,7 @@ function wp_check_password($password, $hash, $user_id = '') {
|
||||
|
||||
// If the hash is still md5...
|
||||
if ( strlen($hash) <= 32 ) {
|
||||
$check = ( $hash == md5($password) );
|
||||
$check = hash_equals( $hash, md5( $password ) );
|
||||
if ( $check && $user_id ) {
|
||||
// Rehash using new hash.
|
||||
wp_set_password($password, $user_id);
|
||||
@@ -2107,7 +2122,8 @@ function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
|
||||
$out = str_replace( '&', '&', esc_url( $out ) );
|
||||
$avatar = "<img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
|
||||
} else {
|
||||
$avatar = "<img alt='{$safe_alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />";
|
||||
$out = esc_url( $default );
|
||||
$avatar = "<img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2200,3 +2216,35 @@ function wp_text_diff( $left_string, $right_string, $args = null ) {
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'hash_equals' ) ) :
|
||||
/**
|
||||
* Compare two strings in constant time.
|
||||
*
|
||||
* This function is NOT pluggable. It is in this file (in addition to
|
||||
* compat.php) to prevent errors if, during an update, pluggable.php
|
||||
* copies over but compat.php does not.
|
||||
*
|
||||
* This function was added in PHP 5.6.
|
||||
* It can leak the length of a string.
|
||||
*
|
||||
* @since 3.9.2
|
||||
*
|
||||
* @param string $a Expected string.
|
||||
* @param string $b Actual string.
|
||||
* @return bool Whether strings are equal.
|
||||
*/
|
||||
function hash_equals( $a, $b ) {
|
||||
$a_length = strlen( $a );
|
||||
if ( $a_length !== strlen( $b ) ) {
|
||||
return false;
|
||||
}
|
||||
$result = 0;
|
||||
|
||||
// Do not attempt to "optimize" this.
|
||||
for ( $i = 0; $i < $a_length; $i++ ) {
|
||||
$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
|
||||
}
|
||||
|
||||
return $result === 0;
|
||||
}
|
||||
endif;
|
||||
|
||||
@@ -2736,10 +2736,11 @@ function wp_untrash_post_comments($post = null) {
|
||||
|
||||
foreach ( $group_by_status as $status => $comments ) {
|
||||
// Sanity check. This shouldn't happen.
|
||||
if ( 'post-trashed' == $status )
|
||||
if ( 'post-trashed' == $status ) {
|
||||
$status = '0';
|
||||
$comments_in = implode( "', '", $comments );
|
||||
$wpdb->query( "UPDATE $wpdb->comments SET comment_approved = '$status' WHERE comment_ID IN ('" . $comments_in . "')" );
|
||||
}
|
||||
$comments_in = implode( ', ', array_map( 'intval', $comments ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) );
|
||||
}
|
||||
|
||||
clean_comment_cache( array_keys($statuses) );
|
||||
|
||||
@@ -635,7 +635,7 @@ function wp_default_styles( &$styles ) {
|
||||
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array( 'dashicons' ) );
|
||||
$styles->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelementplayer.min.css", array(), '2.13.0' );
|
||||
$styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.css", array( 'mediaelement' ) );
|
||||
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ), '20131201' );
|
||||
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array( 'dashicons' ) );
|
||||
|
||||
// Deprecated CSS
|
||||
$styles->add( 'media', "/wp-admin/css/deprecated-media$suffix.css" );
|
||||
|
||||
@@ -185,9 +185,10 @@ function has_shortcode( $content, $tag ) {
|
||||
* @uses get_shortcode_regex() Gets the search pattern for searching shortcodes.
|
||||
*
|
||||
* @param string $content Content to search for shortcodes
|
||||
* @param bool $ignore_html When true, shortcodes inside HTML elements will be skipped.
|
||||
* @return string Content with shortcodes filtered out.
|
||||
*/
|
||||
function do_shortcode($content) {
|
||||
function do_shortcode( $content, $ignore_html = false ) {
|
||||
global $shortcode_tags;
|
||||
|
||||
if ( false === strpos( $content, '[' ) ) {
|
||||
@@ -197,8 +198,24 @@ function do_shortcode($content) {
|
||||
if (empty($shortcode_tags) || !is_array($shortcode_tags))
|
||||
return $content;
|
||||
|
||||
$tagnames = array_keys($shortcode_tags);
|
||||
$tagregexp = join( '|', array_map('preg_quote', $tagnames) );
|
||||
$pattern = "/\\[($tagregexp)/s";
|
||||
|
||||
if ( 1 !== preg_match( $pattern, $content ) ) {
|
||||
// Avoids parsing HTML when there are no shortcodes or embeds anyway.
|
||||
return $content;
|
||||
}
|
||||
|
||||
$content = do_shortcodes_in_html_tags( $content, $ignore_html );
|
||||
|
||||
$pattern = get_shortcode_regex();
|
||||
return preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $content );
|
||||
$content = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $content );
|
||||
|
||||
// Always restore square braces so we don't break things like <!--[if IE ]>
|
||||
$content = unescape_invalid_shortcodes( $content );
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,6 +308,127 @@ function do_shortcode_tag( $m ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search only inside HTML elements for shortcodes and process them.
|
||||
*
|
||||
* Any [ or ] characters remaining inside elements will be HTML encoded
|
||||
* to prevent interference with shortcodes that are outside the elements.
|
||||
* Assumes $content processed by KSES already. Users with unfiltered_html
|
||||
* capability may get unexpected output if angle braces are nested in tags.
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $content Content to search for shortcodes
|
||||
* @param bool $ignore_html When true, all square braces inside elements will be encoded.
|
||||
* @return string Content with shortcodes filtered out.
|
||||
*/
|
||||
function do_shortcodes_in_html_tags( $content, $ignore_html ) {
|
||||
// Normalize entities in unfiltered HTML before adding placeholders.
|
||||
$trans = array( '[' => '[', ']' => ']' );
|
||||
$content = strtr( $content, $trans );
|
||||
$trans = array( '[' => '[', ']' => ']' );
|
||||
|
||||
$pattern = get_shortcode_regex();
|
||||
$textarr = wp_html_split( $content );
|
||||
|
||||
foreach ( $textarr as &$element ) {
|
||||
if ( '' == $element || '<' !== $element[0] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$noopen = false === strpos( $element, '[' );
|
||||
$noclose = false === strpos( $element, ']' );
|
||||
if ( $noopen || $noclose ) {
|
||||
// This element does not contain shortcodes.
|
||||
if ( $noopen xor $noclose ) {
|
||||
// Need to encode stray [ or ] chars.
|
||||
$element = strtr( $element, $trans );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $ignore_html || '<!--' === substr( $element, 0, 4 ) || '<![CDATA[' === substr( $element, 0, 9 ) ) {
|
||||
// Encode all [ and ] chars.
|
||||
$element = strtr( $element, $trans );
|
||||
continue;
|
||||
}
|
||||
|
||||
$attributes = wp_kses_attr_parse( $element );
|
||||
if ( false === $attributes ) {
|
||||
// Some plugins are doing things like [name] <[email]>.
|
||||
if ( 1 === preg_match( '%^<\s*\[\[?[^\[\]]+\]%', $element ) ) {
|
||||
$element = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $element );
|
||||
}
|
||||
|
||||
// Looks like we found some crazy unfiltered HTML. Skipping it for sanity.
|
||||
$element = strtr( $element, $trans );
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get element name
|
||||
$front = array_shift( $attributes );
|
||||
$back = array_pop( $attributes );
|
||||
$matches = array();
|
||||
preg_match('%[a-zA-Z0-9]+%', $front, $matches);
|
||||
$elname = $matches[0];
|
||||
|
||||
// Look for shortcodes in each attribute separately.
|
||||
foreach ( $attributes as &$attr ) {
|
||||
$open = strpos( $attr, '[' );
|
||||
$close = strpos( $attr, ']' );
|
||||
if ( false === $open || false === $close ) {
|
||||
continue; // Go to next attribute. Square braces will be escaped at end of loop.
|
||||
}
|
||||
$double = strpos( $attr, '"' );
|
||||
$single = strpos( $attr, "'" );
|
||||
if ( ( false === $single || $open < $single ) && ( false === $double || $open < $double ) ) {
|
||||
// $attr like '[shortcode]' or 'name = [shortcode]' implies unfiltered_html.
|
||||
// In this specific situation we assume KSES did not run because the input
|
||||
// was written by an administrator, so we should avoid changing the output
|
||||
// and we do not need to run KSES here.
|
||||
$attr = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $attr );
|
||||
} else {
|
||||
// $attr like 'name = "[shortcode]"' or "name = '[shortcode]'"
|
||||
// We do not know if $content was unfiltered. Assume KSES ran before shortcodes.
|
||||
$count = 0;
|
||||
$new_attr = preg_replace_callback( "/$pattern/s", 'do_shortcode_tag', $attr, -1, $count );
|
||||
if ( $count > 0 ) {
|
||||
// Sanitize the shortcode output using KSES.
|
||||
$new_attr = wp_kses_one_attr( $new_attr, $elname );
|
||||
if ( '' !== $new_attr ) {
|
||||
// The shortcode is safe to use now.
|
||||
$attr = $new_attr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$element = $front . implode( '', $attributes ) . $back;
|
||||
|
||||
// Now encode any remaining [ or ] chars.
|
||||
$element = strtr( $element, $trans );
|
||||
}
|
||||
|
||||
$content = implode( '', $textarr );
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove placeholders added by do_shortcodes_in_html_tags().
|
||||
*
|
||||
* @since 4.2.3
|
||||
*
|
||||
* @param string $content Content to search for placeholders.
|
||||
* @return string Content with placeholders removed.
|
||||
*/
|
||||
function unescape_invalid_shortcodes( $content ) {
|
||||
// Clean up entire string, avoids re-parsing HTML.
|
||||
$trans = array( '[' => '[', ']' => ']' );
|
||||
$content = strtr( $content, $trans );
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all attributes from the shortcodes tag.
|
||||
*
|
||||
@@ -320,6 +458,15 @@ function shortcode_parse_atts($text) {
|
||||
elseif (isset($m[8]))
|
||||
$atts[] = stripcslashes($m[8]);
|
||||
}
|
||||
|
||||
// Reject any unclosed HTML elements
|
||||
foreach( $atts as &$value ) {
|
||||
if ( false !== strpos( $value, '<' ) ) {
|
||||
if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) {
|
||||
$value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$atts = ltrim($text);
|
||||
}
|
||||
@@ -390,9 +537,15 @@ function strip_shortcodes( $content ) {
|
||||
if (empty($shortcode_tags) || !is_array($shortcode_tags))
|
||||
return $content;
|
||||
|
||||
$pattern = get_shortcode_regex();
|
||||
$content = do_shortcodes_in_html_tags( $content, true );
|
||||
|
||||
return preg_replace_callback( "/$pattern/s", 'strip_shortcode_tag', $content );
|
||||
$pattern = get_shortcode_regex();
|
||||
$content = preg_replace_callback( "/$pattern/s", 'strip_shortcode_tag', $content );
|
||||
|
||||
// Always restore square braces so we don't break things like <!--[if IE ]>
|
||||
$content = unescape_invalid_shortcodes( $content );
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
function strip_shortcode_tag( $m ) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user