Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e3dcd8b0d | ||
|
|
bf6eb0bc86 | ||
|
|
5843d8201a | ||
|
|
b15f7577d3 | ||
|
|
47e67b7d33 | ||
|
|
b747172c20 | ||
|
|
df44f6cbc4 | ||
|
|
63325a253e | ||
|
|
01fbbebff4 | ||
|
|
97bcc889a7 | ||
|
|
45dc424bc1 | ||
|
|
4113f3fb69 | ||
|
|
c75e86705a | ||
|
|
f5fdf443eb | ||
|
|
9b7c749c86 | ||
|
|
e05facfc58 | ||
|
|
c3a292dc76 | ||
|
|
e09e36af80 | ||
|
|
ddfbf0cbe4 | ||
|
|
caf7ab7df5 | ||
|
|
d04d7ae710 | ||
|
|
71b97108db | ||
|
|
c988d1e5ac | ||
|
|
4a57c6bace | ||
|
|
3d0c06e1f6 | ||
|
|
677c67fa2f | ||
|
|
53acd1636d | ||
|
|
e16574e010 | ||
|
|
946b2cc8a2 | ||
|
|
5d60412106 | ||
|
|
d7d01a4a5e | ||
|
|
2429d91496 | ||
|
|
ee28ddbf8f | ||
|
|
bb244816c7 | ||
|
|
a9a70e1bfb | ||
|
|
d7f37d8bc0 | ||
|
|
31d8e7d909 | ||
|
|
998a0152f4 | ||
|
|
20d537e973 | ||
|
|
59123b5b24 | ||
|
|
c84cda9fd0 | ||
|
|
44e684419b | ||
|
|
9bfc7ded12 | ||
|
|
3ea969bb66 | ||
|
|
ca63f2f7bc | ||
|
|
02f7ebf6bd | ||
|
|
9f63726656 | ||
|
|
58ef0cfe87 | ||
|
|
8a1f083851 | ||
|
|
62ba7f4052 | ||
|
|
b363cf3170 | ||
|
|
9141a73031 | ||
|
|
f0152dc74c | ||
|
|
a367bb8b59 | ||
|
|
4851ef111c | ||
|
|
d82e5908da |
@@ -9,7 +9,7 @@
|
||||
<body>
|
||||
<h1 id="logo">
|
||||
<a href="https://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
|
||||
<br /> Version 4.5
|
||||
<br /> Version 4.5.3
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
|
||||
@@ -38,6 +38,21 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
|
||||
<p><?php printf( _n( '<strong>Version %s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %s</strong> addressed some security issues and fixed %2$s bugs.', 17 ), '4.5.3', number_format_i18n( 17 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.5.3' ); ?>
|
||||
</p>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '4.5.2' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.5.2' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 12 ), '4.5.1', number_format_i18n( 12 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.5.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="headline-feature feature-video" style="background-color:#191E23;">
|
||||
<iframe width="1050" height="591" src="<?php echo esc_url( $video_url ); ?>" frameborder="0" allowfullscreen></iframe>
|
||||
<script src="https://videopress.com/videopress-iframe.js"></script>
|
||||
|
||||
@@ -1586,9 +1586,9 @@ body.full-overlay-active {
|
||||
}
|
||||
|
||||
.preview-tablet .wp-full-overlay-main {
|
||||
margin: auto -3in auto 0;
|
||||
width: 6in; /* Size is loosely based on a typical "tablet" device size. Intentionally ambiguous - this does not represent any particular device precisely. */
|
||||
height: 9in;
|
||||
margin: auto -360px auto 0;
|
||||
width: 720px; /* Size is loosely based on a typical "tablet" device size. Intentionally ambiguous - this does not represent any particular device precisely. */
|
||||
height: 1080px;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
right: 50%;
|
||||
|
||||
2
wp-admin/css/themes-rtl.min.css
vendored
2
wp-admin/css/themes-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1586,9 +1586,9 @@ body.full-overlay-active {
|
||||
}
|
||||
|
||||
.preview-tablet .wp-full-overlay-main {
|
||||
margin: auto 0 auto -3in;
|
||||
width: 6in; /* Size is loosely based on a typical "tablet" device size. Intentionally ambiguous - this does not represent any particular device precisely. */
|
||||
height: 9in;
|
||||
margin: auto 0 auto -360px;
|
||||
width: 720px; /* Size is loosely based on a typical "tablet" device size. Intentionally ambiguous - this does not represent any particular device precisely. */
|
||||
height: 1080px;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
left: 50%;
|
||||
|
||||
2
wp-admin/css/themes.min.css
vendored
2
wp-admin/css/themes.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -2602,7 +2602,7 @@ function wp_ajax_send_attachment_to_editor() {
|
||||
$rel = $rel ? ' rel="attachment wp-att-' . $id . '"' : ''; // Hard-coded string, $id is already sanitized
|
||||
|
||||
if ( ! empty( $url ) ) {
|
||||
$html = '<a href="' . esc_url( $url ) . '"' . $rel . '">' . $html . '</a>';
|
||||
$html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2761,7 +2761,7 @@ function wp_ajax_get_revision_diffs() {
|
||||
if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
|
||||
wp_send_json_error();
|
||||
|
||||
if ( ! current_user_can( 'read_post', $post->ID ) )
|
||||
if ( ! current_user_can( 'edit_post', $post->ID ) )
|
||||
wp_send_json_error();
|
||||
|
||||
// Really just pre-loading the cache here.
|
||||
|
||||
@@ -395,7 +395,7 @@ class WP_Media_List_Table extends WP_List_Table {
|
||||
<span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span>
|
||||
<?php
|
||||
$file = get_attached_file( $post->ID );
|
||||
echo wp_basename( $file );
|
||||
echo esc_html( wp_basename( $file ) );
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
|
||||
@@ -491,7 +491,7 @@ function iis7_rewrite_rule_exists($filename) {
|
||||
if ( $doc->load($filename) === false )
|
||||
return false;
|
||||
$xpath = new DOMXPath($doc);
|
||||
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
|
||||
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
|
||||
if ( $rules->length == 0 )
|
||||
return false;
|
||||
else
|
||||
@@ -521,7 +521,7 @@ function iis7_delete_rewrite_rule($filename) {
|
||||
if ( $doc -> load($filename) === false )
|
||||
return false;
|
||||
$xpath = new DOMXPath($doc);
|
||||
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
|
||||
$rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
|
||||
if ( $rules->length > 0 ) {
|
||||
$child = $rules->item(0);
|
||||
$parent = $child->parentNode;
|
||||
@@ -562,7 +562,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) {
|
||||
$xpath = new DOMXPath($doc);
|
||||
|
||||
// First check if the rule already exists as in that case there is no need to re-add it
|
||||
$wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]');
|
||||
$wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]');
|
||||
if ( $wordpress_rules->length > 0 )
|
||||
return true;
|
||||
|
||||
|
||||
@@ -165,6 +165,13 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
$post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] );
|
||||
}
|
||||
|
||||
if ( isset( $post_data['post_category'] ) ) {
|
||||
$category_object = get_taxonomy( 'category' );
|
||||
if ( ! current_user_can( $category_object->cap->assign_terms ) ) {
|
||||
unset( $post_data['post_category'] );
|
||||
}
|
||||
}
|
||||
|
||||
return $post_data;
|
||||
}
|
||||
|
||||
@@ -1312,7 +1319,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
|
||||
if ( false !== $view_link ) {
|
||||
$display_link = urldecode( $view_link );
|
||||
$return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a>\n";
|
||||
$return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . esc_html( $display_link ) . "</a>\n";
|
||||
} else {
|
||||
$return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
|
||||
}
|
||||
@@ -1336,14 +1343,14 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
|
||||
}
|
||||
}
|
||||
|
||||
$post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );
|
||||
$post_name_html = '<span id="editable-post-name">' . esc_html( $post_name_abridged ) . '</span>';
|
||||
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, esc_html( urldecode( $permalink ) ) );
|
||||
|
||||
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
|
||||
$return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
|
||||
$return .= '‎'; // Fix bi-directional text display defect in RTL languages.
|
||||
$return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js" aria-label="' . __( 'Edit permalink' ) . '">' . __( 'Edit' ) . "</button></span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
|
||||
$return .= '<span id="editable-post-name-full">' . esc_html( $post_name ) . "</span>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2154,6 +2154,9 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
*/
|
||||
$iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
|
||||
|
||||
$text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );
|
||||
$blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );
|
||||
|
||||
$global_tables = $wpdb->tables( 'global' );
|
||||
foreach ( $cqueries as $table => $qry ) {
|
||||
// Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.
|
||||
@@ -2223,9 +2226,24 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
|
||||
// Is actual field type different from the field type in query?
|
||||
if ($tablefield->Type != $fieldtype) {
|
||||
$do_change = true;
|
||||
if ( in_array( strtolower( $fieldtype ), $text_fields ) && in_array( strtolower( $tablefield->Type ), $text_fields ) ) {
|
||||
if ( array_search( strtolower( $fieldtype ), $text_fields ) < array_search( strtolower( $tablefield->Type ), $text_fields ) ) {
|
||||
$do_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( in_array( strtolower( $fieldtype ), $blob_fields ) && in_array( strtolower( $tablefield->Type ), $blob_fields ) ) {
|
||||
if ( array_search( strtolower( $fieldtype ), $blob_fields ) < array_search( strtolower( $tablefield->Type ), $blob_fields ) ) {
|
||||
$do_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $do_change ) {
|
||||
// Add a query to change the column type
|
||||
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
|
||||
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
|
||||
$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
|
||||
$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
|
||||
}
|
||||
}
|
||||
|
||||
// Get the default value from the array
|
||||
|
||||
@@ -49,30 +49,108 @@ $num_locations = count( array_keys( $locations ) );
|
||||
// Allowed actions: add, update, delete
|
||||
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';
|
||||
|
||||
/**
|
||||
* If a JSON blob of navigation menu data is in POST data, expand it and inject
|
||||
* it into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.
|
||||
*
|
||||
* @ignore
|
||||
* @since 4.5.3
|
||||
* @access private
|
||||
*/
|
||||
function _wp_expand_nav_menu_post_data() {
|
||||
if ( ! isset( $_POST['nav-menu-data'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = json_decode( stripslashes( $_POST['nav-menu-data'] ) );
|
||||
|
||||
if ( ! is_null( $data ) && $data ) {
|
||||
foreach ( $data as $post_input_data ) {
|
||||
// For input names that are arrays (e.g. `menu-item-db-id[3][4][5]`),
|
||||
// derive the array path keys via regex and set the value in $_POST.
|
||||
preg_match( '#([^\[]*)(\[(.+)\])?#', $post_input_data->name, $matches );
|
||||
|
||||
$array_bits = array( $matches[1] );
|
||||
|
||||
if ( isset( $matches[3] ) ) {
|
||||
$array_bits = array_merge( $array_bits, explode( '][', $matches[3] ) );
|
||||
}
|
||||
|
||||
$new_post_data = array();
|
||||
|
||||
// Build the new array value from leaf to trunk.
|
||||
for ( $i = count( $array_bits ) - 1; $i >= 0; $i -- ) {
|
||||
if ( $i == count( $array_bits ) - 1 ) {
|
||||
$new_post_data[ $array_bits[ $i ] ] = wp_slash( $post_input_data->value );
|
||||
} else {
|
||||
$new_post_data = array( $array_bits[ $i ] => $new_post_data );
|
||||
}
|
||||
}
|
||||
|
||||
$_POST = array_replace_recursive( $_POST, $new_post_data );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'array_replace_recursive' ) ) :
|
||||
/**
|
||||
* PHP-agnostic version of {@link array_replace_recursive()}.
|
||||
*
|
||||
* The array_replace_recursive() function is a PHP 5.3 function. WordPress
|
||||
* currently supports down to PHP 5.2, so this method is a workaround
|
||||
* for PHP 5.2.
|
||||
*
|
||||
* Note: array_replace_recursive() supports infinite arguments, but for our use-
|
||||
* case, we only need to support two arguments.
|
||||
*
|
||||
* Subject to removal once WordPress makes PHP 5.3.0 the minimum requirement.
|
||||
*
|
||||
* @since 4.5.3
|
||||
*
|
||||
* @see http://php.net/manual/en/function.array-replace-recursive.php#109390
|
||||
*
|
||||
* @param array $base Array with keys needing to be replaced.
|
||||
* @param array $replacements Array with the replaced keys.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function array_replace_recursive( $base = array(), $replacements = array() ) {
|
||||
foreach ( array_slice( func_get_args(), 1 ) as $replacements ) {
|
||||
$bref_stack = array( &$base );
|
||||
$head_stack = array( $replacements );
|
||||
|
||||
do {
|
||||
end( $bref_stack );
|
||||
|
||||
$bref = &$bref_stack[ key( $bref_stack ) ];
|
||||
$head = array_pop( $head_stack );
|
||||
|
||||
unset( $bref_stack[ key( $bref_stack ) ] );
|
||||
|
||||
foreach ( array_keys( $head ) as $key ) {
|
||||
if ( isset( $key, $bref ) &&
|
||||
isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
|
||||
isset( $head[ $key ] ) && is_array( $head[ $key ] )
|
||||
) {
|
||||
$bref_stack[] = &$bref[ $key ];
|
||||
$head_stack[] = $head[ $key ];
|
||||
} else {
|
||||
$bref[ $key ] = $head[ $key ];
|
||||
}
|
||||
}
|
||||
} while ( count( $head_stack ) );
|
||||
}
|
||||
|
||||
return $base;
|
||||
}
|
||||
endif;
|
||||
|
||||
/*
|
||||
* If a JSON blob of navigation menu data is found, expand it and inject it
|
||||
* into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134.
|
||||
*/
|
||||
if ( isset( $_POST['nav-menu-data'] ) ) {
|
||||
$data = json_decode( stripslashes( $_POST['nav-menu-data'] ) );
|
||||
if ( ! is_null( $data ) && $data ) {
|
||||
foreach ( $data as $post_input_data ) {
|
||||
// For input names that are arrays (e.g. `menu-item-db-id[3]`), derive the array path keys via regex.
|
||||
if ( preg_match( '#(.*)\[(\w+)\]#', $post_input_data->name, $matches ) ) {
|
||||
if ( empty( $_POST[ $matches[1] ] ) ) {
|
||||
$_POST[ $matches[1] ] = array();
|
||||
}
|
||||
// Cast input elements with a numeric array index to integers.
|
||||
if ( is_numeric( $matches[2] ) ) {
|
||||
$matches[2] = (int) $matches[2];
|
||||
}
|
||||
$_POST[ $matches[1] ][ $matches[2] ] = wp_slash( $post_input_data->value );
|
||||
} else {
|
||||
$_POST[ $post_input_data->name ] = wp_slash( $post_input_data->value );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_wp_expand_nav_menu_post_data();
|
||||
|
||||
switch ( $action ) {
|
||||
case 'add-menu-item':
|
||||
check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' );
|
||||
|
||||
@@ -84,7 +84,7 @@ if ( is_multisite() && ! is_super_admin() && 'update' != $action ) {
|
||||
$whitelist_options = array(
|
||||
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG' ),
|
||||
'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
|
||||
'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'medium_large_size_w', 'medium_large_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
|
||||
'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ),
|
||||
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
|
||||
'writing' => array( 'default_category', 'default_email_category', 'default_link_category', 'default_post_format' )
|
||||
);
|
||||
|
||||
@@ -63,7 +63,7 @@ default :
|
||||
if ( ! $post = get_post( $revision->post_parent ) )
|
||||
break;
|
||||
|
||||
if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'read_post', $post->ID ) )
|
||||
if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) )
|
||||
break;
|
||||
|
||||
// Revisions disabled and we're not looking at an autosave
|
||||
|
||||
@@ -315,10 +315,32 @@ class WP_oEmbed {
|
||||
* @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
|
||||
*/
|
||||
public function get_html( $url, $args = '' ) {
|
||||
/**
|
||||
* Filters the oEmbed result before any HTTP requests are made.
|
||||
*
|
||||
* This allows one to short-circuit the default logic, perhaps by
|
||||
* replacing it with a routine that is more optimal for your setup.
|
||||
*
|
||||
* Passing a non-null value to the filter will effectively short-circuit retrieval,
|
||||
* returning the passed value instead.
|
||||
*
|
||||
* @since 4.5.3
|
||||
*
|
||||
* @param null|string $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.
|
||||
* @param string $url The URL to the content that should be attempted to be embedded.
|
||||
* @param array $args Optional. Arguments, usually passed from a shortcode. Default empty.
|
||||
*/
|
||||
$pre = apply_filters( 'pre_oembed_result', null, $url, $args );
|
||||
|
||||
if ( null !== $pre ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
$provider = $this->get_provider( $url, $args );
|
||||
|
||||
if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) )
|
||||
if ( ! $provider || false === $data = $this->fetch( $provider, $url, $args ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the HTML returned by the oEmbed provider.
|
||||
|
||||
@@ -1542,6 +1542,7 @@ final class WP_Customize_Manager {
|
||||
* @param string $preview_url URL to be previewed.
|
||||
*/
|
||||
public function set_preview_url( $preview_url ) {
|
||||
$preview_url = esc_url_raw( $preview_url );
|
||||
$this->preview_url = wp_validate_redirect( $preview_url, home_url( '/' ) );
|
||||
}
|
||||
|
||||
@@ -1573,6 +1574,7 @@ final class WP_Customize_Manager {
|
||||
* @param string $return_url URL for return link.
|
||||
*/
|
||||
public function set_return_url( $return_url ) {
|
||||
$return_url = esc_url_raw( $return_url );
|
||||
$return_url = remove_query_arg( wp_removable_query_args(), $return_url );
|
||||
$return_url = wp_validate_redirect( $return_url );
|
||||
$this->return_url = $return_url;
|
||||
|
||||
@@ -1061,7 +1061,7 @@ final class WP_Customize_Widgets {
|
||||
* @return array
|
||||
*/
|
||||
public function preview_sidebars_widgets( $sidebars_widgets ) {
|
||||
$sidebars_widgets = get_option( 'sidebars_widgets' );
|
||||
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
|
||||
|
||||
unset( $sidebars_widgets['array_version'] );
|
||||
return $sidebars_widgets;
|
||||
|
||||
@@ -376,8 +376,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
||||
*/
|
||||
if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) )
|
||||
&& is_callable( array( $this->image, 'setImageAlphaChannel' ) )
|
||||
&& defined( Imagick::ALPHACHANNEL_UNDEFINED )
|
||||
&& defined( Imagick::ALPHACHANNEL_OPAQUE )
|
||||
&& defined( 'Imagick::ALPHACHANNEL_UNDEFINED' )
|
||||
&& defined( 'Imagick::ALPHACHANNEL_OPAQUE' )
|
||||
) {
|
||||
if ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) {
|
||||
$this->image->setImageAlphaChannel( Imagick::ALPHACHANNEL_OPAQUE );
|
||||
|
||||
@@ -214,7 +214,7 @@ class WP_Customize_Media_Control extends WP_Customize_Control {
|
||||
</div>
|
||||
<div class="actions">
|
||||
<# if ( data.defaultAttachment ) { #>
|
||||
<button type="button" class="button default-button">{{ data.button_labels.default }}</button>
|
||||
<button type="button" class="button default-button">{{ data.button_labels['default'] }}</button>
|
||||
<# } #>
|
||||
<# if ( data.canUpload ) { #>
|
||||
<button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button">{{ data.button_labels.select }}</button>
|
||||
|
||||
@@ -60,6 +60,7 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
|
||||
</label>
|
||||
|
||||
<# if ( data.attachment && data.attachment.id ) { #>
|
||||
<# if ( data.attachment.sizes ) { #>
|
||||
<div class="current">
|
||||
<div class="container">
|
||||
<div class="site-icon-preview">
|
||||
@@ -75,6 +76,7 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<# } #>
|
||||
<div class="actions">
|
||||
<# if ( data.canUpload ) { #>
|
||||
<button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
|
||||
|
||||
@@ -476,5 +476,6 @@ add_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' );
|
||||
|
||||
add_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10, 3 );
|
||||
add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 );
|
||||
add_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10, 3 );
|
||||
|
||||
unset( $filter, $action );
|
||||
|
||||
@@ -1079,3 +1079,39 @@ function the_embed_site_title() {
|
||||
*/
|
||||
echo apply_filters( 'embed_site_title_html', $site_title );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the oEmbed result before any HTTP requests are made.
|
||||
*
|
||||
* If the URL belongs to the current site, the result is fetched directly instead of
|
||||
* going through the oEmbed discovery process.
|
||||
*
|
||||
* @since 4.5.3
|
||||
*
|
||||
* @param null|string $result The UNSANITIZED (and potentially unsafe) HTML that should be used to embed. Default null.
|
||||
* @param string $url The URL that should be inspected for discovery `<link>` tags.
|
||||
* @param array $args oEmbed remote get arguments.
|
||||
* @return null|string The UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
|
||||
* Null if the URL does not belong to the current site.
|
||||
*/
|
||||
function wp_filter_pre_oembed_result( $result, $url, $args ) {
|
||||
$post_id = url_to_postid( $url );
|
||||
|
||||
/** This filter is documented in wp-includes/class-wp-oembed-controller.php */
|
||||
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );
|
||||
|
||||
if ( ! $post_id ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
$width = isset( $args['width'] ) ? $args['width'] : 0;
|
||||
|
||||
$data = get_oembed_response_data( $post_id, $width );
|
||||
$data = _wp_oembed_get_object()->data2html( (object) $data, $url );
|
||||
|
||||
if ( ! $data ) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -630,10 +630,11 @@ function feed_content_type( $type = '' ) {
|
||||
$type = get_default_feed();
|
||||
|
||||
$types = array(
|
||||
'rss' => 'application/rss+xml',
|
||||
'rss2' => 'application/rss+xml',
|
||||
'atom' => 'application/atom+xml',
|
||||
'rdf' => 'application/rdf+xml'
|
||||
'rss' => 'application/rss+xml',
|
||||
'rss2' => 'application/rss+xml',
|
||||
'rss-http' => 'text/xml',
|
||||
'atom' => 'application/atom+xml',
|
||||
'rdf' => 'application/rdf+xml'
|
||||
);
|
||||
|
||||
$content_type = ( !empty($types[$type]) ) ? $types[$type] : 'application/octet-stream';
|
||||
|
||||
@@ -1364,7 +1364,8 @@ function remove_accents( $string ) {
|
||||
* operating systems and special characters requiring special escaping
|
||||
* to manipulate at the command line. Replaces spaces and consecutive
|
||||
* dashes with a single dash. Trims period, dash and underscore from beginning
|
||||
* and end of filename.
|
||||
* and end of filename. It is not guaranteed that this function will return a
|
||||
* filename that is allowed to be uploaded.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
@@ -1389,6 +1390,14 @@ function sanitize_file_name( $filename ) {
|
||||
$filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
|
||||
$filename = trim( $filename, '.-_' );
|
||||
|
||||
if ( false === strpos( $filename, '.' ) ) {
|
||||
$mime_types = wp_get_mime_types();
|
||||
$filetype = wp_check_filetype( 'test.' . $filename, $mime_types );
|
||||
if ( $filetype['ext'] === $filename ) {
|
||||
$filename = 'unnamed-file.' . $filetype['ext'];
|
||||
}
|
||||
}
|
||||
|
||||
// Split the filename into a base and extension[s]
|
||||
$parts = explode('.', $filename);
|
||||
|
||||
@@ -4582,7 +4591,7 @@ function print_emoji_detection_script() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
|
||||
!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;if(!g||!g.fillText)return!1;switch(g.textBaseline="top",g.font="600 32px Arial",a){case"flag":return g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3;case"diversity":return g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e;case"simple":return g.fillText(h(55357,56835),0,0),0!==g.getImageData(16,16,1,1).data[0];case"unicode8":return g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;if(!g||!g.fillText)return!1;switch(g.textBaseline="top",g.font="600 32px Arial",a){case"flag":return g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3;case"diversity":return g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,d=c[0]+","+c[1]+","+c[2]+","+c[3],g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e;case"simple":return g.fillText(h(55357,56835),0,0),0!==g.getImageData(16,16,1,1).data[0];case"unicode8":return g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -1854,7 +1854,7 @@ function wp_get_upload_dir() {
|
||||
* @return array See above for description.
|
||||
*/
|
||||
function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) {
|
||||
static $cache = array();
|
||||
static $cache = array(), $tested_paths = array();
|
||||
|
||||
$key = sprintf( '%d-%s', get_current_blog_id(), (string) $time );
|
||||
|
||||
@@ -1874,13 +1874,10 @@ function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false
|
||||
|
||||
if ( $create_dir ) {
|
||||
$path = $uploads['path'];
|
||||
$tested_paths = wp_cache_get( 'upload_dir_tested_paths' );
|
||||
|
||||
if ( ! is_array( $tested_paths ) ) {
|
||||
$tested_paths = array();
|
||||
}
|
||||
|
||||
if ( ! in_array( $path, $tested_paths, true ) ) {
|
||||
if ( array_key_exists( $path, $tested_paths ) ) {
|
||||
$uploads['error'] = $tested_paths[ $path ];
|
||||
} else {
|
||||
if ( ! wp_mkdir_p( $path ) ) {
|
||||
if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) {
|
||||
$error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir'];
|
||||
@@ -1889,10 +1886,9 @@ function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false
|
||||
}
|
||||
|
||||
$uploads['error'] = sprintf( __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), esc_html( $error_path ) );
|
||||
} else {
|
||||
$tested_paths[] = $path;
|
||||
wp_cache_set( 'upload_dir_tested_paths', $tested_paths );
|
||||
}
|
||||
|
||||
$tested_paths[ $path ] = $uploads['error'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
119
wp-includes/js/jquery/jquery-migrate.js
vendored
119
wp-includes/js/jquery/jquery-migrate.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* jQuery Migrate - v1.4.0 - 2016-02-26
|
||||
* jQuery Migrate - v1.4.1 - 2016-05-19
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
@@ -7,7 +7,7 @@
|
||||
// "use strict";
|
||||
|
||||
|
||||
jQuery.migrateVersion = "1.4.0";
|
||||
jQuery.migrateVersion = "1.4.1";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
@@ -193,9 +193,11 @@ jQuery.attrHooks.value = {
|
||||
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
oldFind = jQuery.find,
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
rspaceAngle = /^\s*</,
|
||||
rattrHash = /\[\s*\w+\s*[~|^$*]?=\s*(?![\s'"])[^#\]]*#/,
|
||||
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
|
||||
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
@@ -203,45 +205,37 @@ var matched, browser,
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match, ret;
|
||||
|
||||
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( !rspaceAngle.test( selector ) ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
if ( selector && typeof selector === "string" ) {
|
||||
if ( !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
|
||||
// Consistently reject any HTML-like string starting with a hash (#9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( !rspaceAngle.test( selector ) ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
|
||||
// Consistently reject any HTML-like string starting with a hash (gh-9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
}
|
||||
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
// Is this a jQuery context? parseHTML expects a DOM element (#178)
|
||||
if ( context && context.context && context.context.nodeType ) {
|
||||
context = context.context;
|
||||
}
|
||||
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this,
|
||||
jQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||
|
||||
context || document, true ), context, rootjQuery );
|
||||
}
|
||||
}
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
if ( context && context.context ) {
|
||||
// jQuery object as context; parseHTML expects a DOM object
|
||||
context = context.context;
|
||||
}
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this,
|
||||
jQuery.parseHTML( match[ 2 ], context && context.ownerDocument ||
|
||||
context || document, true ), context, rootjQuery );
|
||||
}
|
||||
}
|
||||
|
||||
if ( selector === "#" ) {
|
||||
|
||||
// jQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0
|
||||
migrateWarn( "jQuery( '#' ) is not a valid selector" );
|
||||
selector = [];
|
||||
|
||||
} else if ( rattrHash.test( selector ) ) {
|
||||
|
||||
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
||||
// Note that this doesn't actually fix the selector due to potential false positives
|
||||
migrateWarn( "Attribute selectors with '#' must be quoted: '" + selector + "'" );
|
||||
}
|
||||
|
||||
ret = oldInit.apply( this, arguments );
|
||||
@@ -263,6 +257,47 @@ jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
jQuery.find = function( selector ) {
|
||||
var args = Array.prototype.slice.call( arguments );
|
||||
|
||||
// Support: PhantomJS 1.x
|
||||
// String#match fails to match when used with a //g RegExp, only on some strings
|
||||
if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
|
||||
|
||||
// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
|
||||
// First see if qS thinks it's a valid selector, if so avoid a false positive
|
||||
try {
|
||||
document.querySelector( selector );
|
||||
} catch ( err1 ) {
|
||||
|
||||
// Didn't *look* valid to qSA, warn and try quoting what we think is the value
|
||||
selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
|
||||
return "[" + attr + op + "\"" + value + "\"]";
|
||||
} );
|
||||
|
||||
// If the regexp *may* have created an invalid selector, don't update it
|
||||
// Note that there may be false alarms if selector uses jQuery extensions
|
||||
try {
|
||||
document.querySelector( selector );
|
||||
migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] );
|
||||
args[ 0 ] = selector;
|
||||
} catch ( err2 ) {
|
||||
migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return oldFind.apply( this, args );
|
||||
};
|
||||
|
||||
// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
|
||||
var findProp;
|
||||
for ( findProp in oldFind ) {
|
||||
if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
|
||||
jQuery.find[ findProp ] = oldFind[ findProp ];
|
||||
}
|
||||
}
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json ) {
|
||||
@@ -631,7 +666,7 @@ jQuery.event.special.ready = {
|
||||
};
|
||||
|
||||
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
|
||||
oldFind = jQuery.fn.find;
|
||||
oldFnFind = jQuery.fn.find;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
@@ -639,7 +674,7 @@ jQuery.fn.andSelf = function() {
|
||||
};
|
||||
|
||||
jQuery.fn.find = function( selector ) {
|
||||
var ret = oldFind.apply( this, arguments );
|
||||
var ret = oldFnFind.apply( this, arguments );
|
||||
ret.context = this.context;
|
||||
ret.selector = this.selector ? this.selector + " " + selector : selector;
|
||||
return ret;
|
||||
|
||||
4
wp-includes/js/jquery/jquery-migrate.min.js
vendored
4
wp-includes/js/jquery/jquery-migrate.min.js
vendored
File diff suppressed because one or more lines are too long
10
wp-includes/js/jquery/jquery.js
vendored
10
wp-includes/js/jquery/jquery.js
vendored
File diff suppressed because one or more lines are too long
@@ -462,14 +462,14 @@ EditImage = wp.media.controller.State.extend({
|
||||
* @since 3.9.0
|
||||
*/
|
||||
activate: function() {
|
||||
this.listenTo( this.frame, 'toolbar:render:edit-image', this.toolbar );
|
||||
this.frame.on( 'toolbar:render:edit-image', _.bind( this.toolbar, this ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* @since 3.9.0
|
||||
*/
|
||||
deactivate: function() {
|
||||
this.stopListening( this.frame );
|
||||
this.frame.off( 'toolbar:render:edit-image' );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -4085,8 +4085,8 @@ AttachmentsBrowser = View.extend({
|
||||
});
|
||||
|
||||
// Add keydown listener to the instance of the Attachments view
|
||||
this.attachments.listenTo( this.controller, 'attachment:keydown:arrow', this.attachments.arrowEvent );
|
||||
this.attachments.listenTo( this.controller, 'attachment:details:shift-tab', this.attachments.restoreFocus );
|
||||
this.controller.on( 'attachment:keydown:arrow', _.bind( this.attachments.arrowEvent, this.attachments ) );
|
||||
this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) );
|
||||
|
||||
this.views.add( this.attachments );
|
||||
|
||||
|
||||
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
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -104,7 +104,7 @@ tinymce.PluginManager.add('fullscreen', function(editor) {
|
||||
}
|
||||
|
||||
editor.on('init', function() {
|
||||
editor.addShortcut('Meta+Alt+F', '', toggleFullscreen);
|
||||
editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen);
|
||||
});
|
||||
|
||||
editor.on('remove', function() {
|
||||
|
||||
@@ -1 +1 @@
|
||||
tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Meta+Alt+F","",e)}),a.on("remove",function(){h&&m.unbind(window,"resize",h)}),a.addCommand("mceFullScreen",e),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:function(){e(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:e,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return l}})});
|
||||
tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){var a=tinymce.DOM.getViewPort();return{x:a.x,y:a.y}}function d(a){scrollTo(a.x,a.y)}function e(){function e(){m.setStyle(p,"height",b().h-(o.clientHeight-p.clientHeight))}var n,o,p,q,r=document.body,s=document.documentElement;l=!l,o=a.getContainer(),n=o.style,p=a.getContentAreaContainer().firstChild,q=p.style,l?(k=c(),f=q.width,g=q.height,q.width=q.height="100%",i=n.width,j=n.height,n.width=n.height="",m.addClass(r,"mce-fullscreen"),m.addClass(s,"mce-fullscreen"),m.addClass(o,"mce-fullscreen"),m.bind(window,"resize",e),e(),h=e):(q.width=f,q.height=g,i&&(n.width=i),j&&(n.height=j),m.removeClass(r,"mce-fullscreen"),m.removeClass(s,"mce-fullscreen"),m.removeClass(o,"mce-fullscreen"),m.unbind(window,"resize",h),d(k)),a.fire("FullscreenStateChanged",{state:l})}var f,g,h,i,j,k,l=!1,m=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Ctrl+Shift+F","",e)}),a.on("remove",function(){h&&m.unbind(window,"resize",h)}),a.addCommand("mceFullScreen",e),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:function(){e(),a.focus()},onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:e,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return l}})});
|
||||
@@ -19,7 +19,8 @@ tinymce.PluginManager.add('media', function(editor, url) {
|
||||
{regex: /youtube.com\/embed\/([a-z0-9\-_]+)/i, type: 'iframe', w: 560, h: 314, url: '//www.youtube.com/embed/$1', allowFullscreen: true},
|
||||
{regex: /vimeo\.com\/([0-9]+)/, type: 'iframe', w: 425, h: 350, url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', allowfullscreen: true},
|
||||
{regex: /vimeo\.com\/(.*)\/([0-9]+)/, type: "iframe", w: 425, h: 350, url: "//player.vimeo.com/video/$2?title=0&byline=0", allowfullscreen: true},
|
||||
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false}
|
||||
{regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, type: 'iframe', w: 425, h: 350, url: '//maps.google.com/maps/ms?msid=$2&output=embed"', allowFullscreen: false},
|
||||
{regex: /dailymotion\.com\/video\/([^_]+)/, type: 'iframe', w: 480, h: 270, url: '//www.dailymotion.com/embed/video/$1', allowFullscreen: true}
|
||||
];
|
||||
|
||||
var embedChange = (tinymce.Env.ie && tinymce.Env.ie <= 8) ? 'onChange' : 'onInput';
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -818,6 +818,10 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
draggingInternally = e.type == 'dragstart';
|
||||
});
|
||||
|
||||
function isPlainTextFileUrl(content) {
|
||||
return content['text/plain'].indexOf('file://') === 0;
|
||||
}
|
||||
|
||||
editor.on('drop', function(e) {
|
||||
var dropContent, rng;
|
||||
|
||||
@@ -829,7 +833,7 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
|
||||
dropContent = getDataTransferItems(e.dataTransfer);
|
||||
|
||||
if (!hasHtmlOrText(dropContent) && pasteImageData(e, rng)) {
|
||||
if ((!hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && pasteImageData(e, rng)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -839,20 +843,23 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
if (content) {
|
||||
e.preventDefault();
|
||||
|
||||
editor.undoManager.transact(function() {
|
||||
if (dropContent['mce-internal']) {
|
||||
editor.execCommand('Delete');
|
||||
}
|
||||
// FF 45 doesn't paint a caret when dragging in text in due to focus call by execCommand
|
||||
Delay.setEditorTimeout(editor, function() {
|
||||
editor.undoManager.transact(function() {
|
||||
if (dropContent['mce-internal']) {
|
||||
editor.execCommand('Delete');
|
||||
}
|
||||
|
||||
editor.selection.setRng(rng);
|
||||
editor.selection.setRng(rng);
|
||||
|
||||
content = Utils.trimHtml(content);
|
||||
content = Utils.trimHtml(content);
|
||||
|
||||
if (!dropContent['text/html']) {
|
||||
pasteText(content);
|
||||
} else {
|
||||
pasteHtml(content);
|
||||
}
|
||||
if (!dropContent['text/html']) {
|
||||
pasteText(content);
|
||||
} else {
|
||||
pasteHtml(content);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1670,7 +1677,7 @@ define("tinymce/pasteplugin/Plugin", [
|
||||
});
|
||||
|
||||
// Block all drag/drop events
|
||||
if (editor.paste_block_drop) {
|
||||
if (editor.settings.paste_block_drop) {
|
||||
editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,8 +14,14 @@
|
||||
tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
var cols, rows;
|
||||
|
||||
rows = editor.settings.textcolor_rows || 5;
|
||||
cols = editor.settings.textcolor_cols || 8;
|
||||
rows = {
|
||||
forecolor: editor.settings.forecolor_rows || editor.settings.textcolor_rows || 5,
|
||||
backcolor: editor.settings.backcolor_rows || editor.settings.textcolor_rows || 5
|
||||
};
|
||||
cols = {
|
||||
forecolor: editor.settings.forecolor_cols || editor.settings.textcolor_cols || 8,
|
||||
backcolor: editor.settings.backcolor_cols || editor.settings.textcolor_cols || 8
|
||||
};
|
||||
|
||||
function getCurrentColor(format) {
|
||||
var color;
|
||||
@@ -31,10 +37,10 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
return color;
|
||||
}
|
||||
|
||||
function mapColors() {
|
||||
function mapColors(type) {
|
||||
var i, colors = [], colorMap;
|
||||
|
||||
colorMap = editor.settings.textcolor_map || [
|
||||
colorMap = [
|
||||
"000000", "Black",
|
||||
"993300", "Burnt orange",
|
||||
"333300", "Dark olive",
|
||||
@@ -76,6 +82,9 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
"CC99FF", "Plum"
|
||||
];
|
||||
|
||||
colorMap = editor.settings.textcolor_map || colorMap;
|
||||
colorMap = editor.settings[type + '_map'] || colorMap;
|
||||
|
||||
for (i = 0; i < colorMap.length; i += 2) {
|
||||
colors.push({
|
||||
text: colorMap[i + 1],
|
||||
@@ -87,7 +96,9 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
}
|
||||
|
||||
function renderColorPicker() {
|
||||
var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0;
|
||||
var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0, type;
|
||||
|
||||
type = ctrl.settings.origin;
|
||||
|
||||
function getColorCellHtml(color, title) {
|
||||
var isNoColor = color == 'transparent';
|
||||
@@ -106,7 +117,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
);
|
||||
}
|
||||
|
||||
colors = mapColors();
|
||||
colors = mapColors(type);
|
||||
colors.push({
|
||||
text: tinymce.translate("No color"),
|
||||
color: "transparent"
|
||||
@@ -115,11 +126,11 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
|
||||
last = colors.length - 1;
|
||||
|
||||
for (y = 0; y < rows; y++) {
|
||||
for (y = 0; y < rows[type]; y++) {
|
||||
html += '<tr>';
|
||||
|
||||
for (x = 0; x < cols; x++) {
|
||||
i = y * cols + x;
|
||||
for (x = 0; x < cols[type]; x++) {
|
||||
i = y * cols[type] + x;
|
||||
|
||||
if (i > last) {
|
||||
html += '<td></td>';
|
||||
@@ -135,7 +146,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
if (editor.settings.color_picker_callback) {
|
||||
html += (
|
||||
'<tr>' +
|
||||
'<td colspan="' + cols + '" class="mce-custom-color-btn">' +
|
||||
'<td colspan="' + cols[type] + '" class="mce-custom-color-btn">' +
|
||||
'<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' +
|
||||
'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' +
|
||||
'<button type="button" role="presentation" tabindex="-1">' + tinymce.translate('Custom...') + '</button>' +
|
||||
@@ -146,7 +157,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
for (x = 0; x < cols; x++) {
|
||||
for (x = 0; x < cols[type]; x++) {
|
||||
html += getColorCellHtml('', 'Custom color');
|
||||
}
|
||||
|
||||
@@ -175,7 +186,9 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
}
|
||||
|
||||
function onPanelClick(e) {
|
||||
var buttonCtrl = this.parent(), value;
|
||||
var buttonCtrl = this.parent(), value, type;
|
||||
|
||||
type = buttonCtrl.settings.origin;
|
||||
|
||||
function selectColor(value) {
|
||||
buttonCtrl.hidePanel();
|
||||
@@ -214,8 +227,8 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
|
||||
// Shift colors to the right
|
||||
// TODO: Might need to be the left on RTL
|
||||
if (i == cols) {
|
||||
for (i = 0; i < cols - 1; i++) {
|
||||
if (i == cols[type]) {
|
||||
for (i = 0; i < cols[type] - 1; i++) {
|
||||
setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
|
||||
}
|
||||
}
|
||||
@@ -259,6 +272,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
tooltip: 'Text color',
|
||||
format: 'forecolor',
|
||||
panel: {
|
||||
origin: 'forecolor',
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker,
|
||||
@@ -272,6 +286,7 @@ tinymce.PluginManager.add('textcolor', function(editor) {
|
||||
tooltip: 'Background color',
|
||||
format: 'hilitecolor',
|
||||
panel: {
|
||||
origin: 'backcolor',
|
||||
role: 'application',
|
||||
ariaRemember: true,
|
||||
html: renderColorPicker,
|
||||
|
||||
@@ -1 +1 @@
|
||||
tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],b=0;b<c.length;b+=2)d.push({text:c[b+1],color:"#"+c[b]});return d}function d(){function b(a,b){var c="transparent"==a;return'<td class="mce-grid-cell'+(c?" mce-colorbtn-trans":"")+'"><div id="'+n+"-"+o++ +'" data-mce-color="'+(a?a:"")+'" role="option" tabIndex="-1" style="'+(a?"background-color: "+a:"")+'" title="'+tinymce.translate(b)+'">'+(c?"×":"")+"</div></td>"}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',g=d.length-1,k=0;j>k;k++){for(f+="<tr>",h=0;i>h;h++)l=k*i+h,l>g?f+="<td></td>":(e=d[l],f+=b(e.color,e.text));f+="</tr>"}if(a.settings.color_picker_callback){for(f+='<tr><td colspan="'+i+'" class="mce-custom-color-btn"><div id="'+n+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+n+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",f+="<tr>",h=0;i>h;h++)f+=b("","Custom color");f+="</tr>"}return f+="</tbody></table>"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){k.hidePanel(),k.color(a),e(k.settings.format,a)}function g(){k.hidePanel(),k.resetColor(),f(k.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k=this.parent();tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(k.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=k.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e<b.length&&(c=b[e],c.getAttribute("data-mce-color"));e++);if(e==i)for(e=0;i-1>e;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(k.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&k.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})});
|
||||
tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(b){var c,d,e=[];for(d=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],d=a.settings.textcolor_map||d,d=a.settings[b+"_map"]||d,c=0;c<d.length;c+=2)e.push({text:d[c+1],color:"#"+d[c]});return e}function d(){function b(a,b){var c="transparent"==a;return'<td class="mce-grid-cell'+(c?" mce-colorbtn-trans":"")+'"><div id="'+o+"-"+p++ +'" data-mce-color="'+(a?a:"")+'" role="option" tabIndex="-1" style="'+(a?"background-color: "+a:"")+'" title="'+tinymce.translate(b)+'">'+(c?"×":"")+"</div></td>"}var d,e,f,g,h,k,l,m,n=this,o=n._id,p=0;for(m=n.settings.origin,d=c(m),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',g=d.length-1,k=0;k<j[m];k++){for(f+="<tr>",h=0;h<i[m];h++)l=k*i[m]+h,l>g?f+="<td></td>":(e=d[l],f+=b(e.color,e.text));f+="</tr>"}if(a.settings.color_picker_callback){for(f+='<tr><td colspan="'+i[m]+'" class="mce-custom-color-btn"><div id="'+o+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+o+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",f+="<tr>",h=0;h<i[m];h++)f+=b("","Custom color");f+="</tr>"}return f+="</tbody></table>"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){l.hidePanel(),l.color(a),e(l.settings.format,a)}function g(){l.hidePanel(),l.resetColor(),f(l.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k,l=this.parent();k=l.settings.origin,tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(l.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=l.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;e<b.length&&(c=b[e],c.getAttribute("data-mce-color"));e++);if(e==i[k])for(e=0;e<i[k]-1;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(l.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&l.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j={forecolor:a.settings.forecolor_rows||a.settings.textcolor_rows||5,backcolor:a.settings.backcolor_rows||a.settings.textcolor_rows||5},i={forecolor:a.settings.forecolor_cols||a.settings.textcolor_cols||8,backcolor:a.settings.backcolor_cols||a.settings.textcolor_cols||8},a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{origin:"forecolor",role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{origin:"backcolor",role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})});
|
||||
@@ -902,7 +902,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
if ( activeToolbar.tempHide || event.type === 'hide' ) {
|
||||
activeToolbar.hide();
|
||||
activeToolbar = false;
|
||||
} else if ( ( event.type === 'resize' || event.type === 'scroll' ) && ! activeToolbar.blockHide ) {
|
||||
} else if ( (
|
||||
event.type === 'resizewindow' ||
|
||||
event.type === 'scrollwindow' ||
|
||||
event.type === 'resize' ||
|
||||
event.type === 'scroll'
|
||||
) && ! activeToolbar.blockHide ) {
|
||||
clearTimeout( timeout );
|
||||
|
||||
timeout = setTimeout( function() {
|
||||
@@ -918,11 +923,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
}
|
||||
}
|
||||
|
||||
DOM.bind( window, 'resize scroll', hide );
|
||||
// For full height editor.
|
||||
editor.on( 'resizewindow scrollwindow', hide );
|
||||
// For scrollable editor.
|
||||
editor.dom.bind( editor.getWin(), 'resize scroll', hide );
|
||||
|
||||
editor.on( 'remove', function() {
|
||||
DOM.unbind( window, 'resize scroll', hide );
|
||||
editor.off( 'resizewindow scrollwindow', hide );
|
||||
editor.dom.unbind( editor.getWin(), 'resize scroll', hide );
|
||||
} );
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -440,10 +440,26 @@
|
||||
$input.autocomplete( 'search' );
|
||||
}
|
||||
} )
|
||||
// Returns a jQuery object containing the menu element.
|
||||
.autocomplete( 'widget' )
|
||||
.addClass( 'wplink-autocomplete' )
|
||||
.attr( 'role', 'listbox' )
|
||||
.removeAttr( 'tabindex' ); // Remove the `tabindex=0` attribute added by jQuery UI.
|
||||
.removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
|
||||
/*
|
||||
* Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
|
||||
* The `menufocus` and `menublur` events are the same events used to add and remove
|
||||
* the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
|
||||
*/
|
||||
.on( 'menufocus', function( event, ui ) {
|
||||
ui.item.attr( 'aria-selected', 'true' );
|
||||
})
|
||||
.on( 'menublur', function() {
|
||||
/*
|
||||
* The `menublur` event returns an object where the item is `null`
|
||||
* so we need to find the active item with other means.
|
||||
*/
|
||||
$( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
|
||||
});
|
||||
}
|
||||
|
||||
tinymce.$( input ).on( 'keydown', function( event ) {
|
||||
@@ -472,7 +488,7 @@
|
||||
edit = $linkNode.attr( 'data-wplink-edit' );
|
||||
|
||||
if ( href === '_wp_link_placeholder' || edit ) {
|
||||
if ( edit && ! inputInstance.getURL() ) {
|
||||
if ( href !== '_wp_link_placeholder' && ! inputInstance.getURL() ) {
|
||||
inputInstance.setURL( href );
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -391,6 +391,53 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
});
|
||||
}
|
||||
|
||||
function togglePositionClass(panel, relPos, predicate) {
|
||||
relPos = relPos ? relPos.substr(0, 2) : '';
|
||||
|
||||
each({
|
||||
t: 'down',
|
||||
b: 'up'
|
||||
}, function(cls, pos) {
|
||||
panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(0, 1)));
|
||||
});
|
||||
|
||||
each({
|
||||
l: 'left',
|
||||
r: 'right'
|
||||
}, function(cls, pos) {
|
||||
panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(1, 1)));
|
||||
});
|
||||
}
|
||||
|
||||
function toClientRect(geomRect) {
|
||||
return {
|
||||
left: geomRect.x,
|
||||
top: geomRect.y,
|
||||
width: geomRect.w,
|
||||
height: geomRect.h,
|
||||
right: geomRect.x + geomRect.w,
|
||||
bottom: geomRect.y + geomRect.h
|
||||
};
|
||||
}
|
||||
|
||||
function userConstrain(x, y, elementRect, contentAreaRect, panelRect) {
|
||||
panelRect = toClientRect({x: x, y: y, w: panelRect.w, h: panelRect.h});
|
||||
|
||||
if (settings.inline_toolbar_position_handler) {
|
||||
panelRect = settings.inline_toolbar_position_handler({
|
||||
elementRect: toClientRect(elementRect),
|
||||
contentAreaRect: toClientRect(contentAreaRect),
|
||||
panelRect: panelRect
|
||||
});
|
||||
}
|
||||
|
||||
return panelRect;
|
||||
}
|
||||
|
||||
function movePanelTo(panel, pos) {
|
||||
panel.moveTo(pos.left, pos.top);
|
||||
}
|
||||
|
||||
function reposition(match) {
|
||||
var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions;
|
||||
|
||||
@@ -404,7 +451,7 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
}
|
||||
|
||||
testPositions = [
|
||||
'tc-bc', 'bc-tc',
|
||||
'bc-tc', 'tc-bc',
|
||||
'tl-bl', 'bl-tl',
|
||||
'tr-br', 'br-tr'
|
||||
];
|
||||
@@ -431,39 +478,36 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
}
|
||||
|
||||
relPos = Rect.findBestRelativePosition(panelRect, elementRect, contentAreaRect, testPositions);
|
||||
elementRect = Rect.clamp(elementRect, contentAreaRect);
|
||||
|
||||
if (relPos) {
|
||||
each(testPositions.concat('inside'), function(pos) {
|
||||
panel.classes.toggle('tinymce-inline-' + pos, pos == relPos);
|
||||
});
|
||||
|
||||
relRect = Rect.relativePosition(panelRect, elementRect, relPos);
|
||||
panel.moveTo(relRect.x, relRect.y);
|
||||
movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
|
||||
} else {
|
||||
each(testPositions, function(pos) {
|
||||
panel.classes.toggle('tinymce-inline-' + pos, false);
|
||||
});
|
||||
|
||||
panel.classes.toggle('tinymce-inline-inside', true);
|
||||
// Allow overflow below the editor to avoid placing toolbars ontop of tables
|
||||
contentAreaRect.h += 40;
|
||||
|
||||
elementRect = Rect.intersect(contentAreaRect, elementRect);
|
||||
|
||||
if (elementRect) {
|
||||
relPos = Rect.findBestRelativePosition(panelRect, elementRect, contentAreaRect, [
|
||||
'tc-tc', 'tl-tl', 'tr-tr'
|
||||
'bc-tc', 'bl-tl', 'br-tr'
|
||||
]);
|
||||
|
||||
if (relPos) {
|
||||
relRect = Rect.relativePosition(panelRect, elementRect, relPos);
|
||||
panel.moveTo(relRect.x, relRect.y);
|
||||
movePanelTo(panel, userConstrain(relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
|
||||
} else {
|
||||
panel.moveTo(elementRect.x, elementRect.y);
|
||||
movePanelTo(panel, userConstrain(elementRect.x, elementRect.y, elementRect, contentAreaRect, panelRect));
|
||||
}
|
||||
} else {
|
||||
panel.hide();
|
||||
}
|
||||
}
|
||||
|
||||
togglePositionClass(panel, relPos, function(pos1, pos2) {
|
||||
return (!elementRect || elementRect.w > 40) && pos1 === pos2;
|
||||
});
|
||||
|
||||
//drawRect(contentAreaRect, 'blue');
|
||||
//drawRect(elementRect, 'red');
|
||||
//drawRect(panelRect, 'green');
|
||||
@@ -503,8 +547,9 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
|
||||
panel = Factory.create({
|
||||
type: 'floatpanel',
|
||||
role: 'application',
|
||||
classes: 'tinymce tinymce-inline',
|
||||
role: 'dialog',
|
||||
classes: 'tinymce tinymce-inline arrow',
|
||||
ariaLabel: 'Inline toolbar',
|
||||
layout: 'flex',
|
||||
direction: 'column',
|
||||
align: 'stretch',
|
||||
@@ -512,7 +557,10 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
autofix: true,
|
||||
fixed: true,
|
||||
border: 1,
|
||||
items: createToolbar(match.toolbar.items)
|
||||
items: createToolbar(match.toolbar.items),
|
||||
oncancel: function() {
|
||||
editor.focus();
|
||||
}
|
||||
});
|
||||
|
||||
match.toolbar.panel = panel;
|
||||
@@ -587,6 +635,13 @@ tinymce.ThemeManager.add('modern', function(editor) {
|
||||
|
||||
editor.contextToolbars = {};
|
||||
});
|
||||
|
||||
editor.shortcuts.add('ctrl+shift+e > ctrl+shift+p', '', function() {
|
||||
var match = findFrontMostMatch(editor.selection.getNode());
|
||||
if (match && match.toolbar.panel) {
|
||||
match.toolbar.panel.items()[0].focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function fireSkinLoaded(editor) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
wp-includes/js/tinymce/tiny_mce_popup.js
vendored
4
wp-includes/js/tinymce/tiny_mce_popup.js
vendored
@@ -107,7 +107,7 @@ var tinyMCEPopup = {
|
||||
* Returns a window argument/parameter by name.
|
||||
*
|
||||
* @method getWindowArg
|
||||
* @param {String} name Name of the window argument to retrive.
|
||||
* @param {String} name Name of the window argument to retrieve.
|
||||
* @param {String} defaultValue Optional default value to return.
|
||||
* @return {String} Argument value or default value if it wasn't found.
|
||||
*/
|
||||
@@ -121,7 +121,7 @@ var tinyMCEPopup = {
|
||||
* Returns a editor parameter/config option value.
|
||||
*
|
||||
* @method getParam
|
||||
* @param {String} name Name of the editor config option to retrive.
|
||||
* @param {String} name Name of the editor config option to retrieve.
|
||||
* @param {String} defaultValue Optional default value to return.
|
||||
* @return {String} Parameter value or default value if it wasn't found.
|
||||
*/
|
||||
|
||||
26
wp-includes/js/tinymce/tinymce.min.js
vendored
26
wp-includes/js/tinymce/tinymce.min.js
vendored
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -49,6 +49,7 @@
|
||||
*/
|
||||
context.fillText( stringFromCharCode( 55356, 57221 ), 0, 0 );
|
||||
tonedata = context.getImageData( 16, 16, 1, 1 ).data;
|
||||
tone = tonedata[0] + ',' + tonedata[1] + ',' + tonedata[2] + ',' + tonedata[3];
|
||||
|
||||
context.fillText( stringFromCharCode( 55356, 57221, 55356, 57343 ), 0, 0 );
|
||||
// Chrome has issues comparing arrays, and Safari has issues converting arrays to strings.
|
||||
|
||||
2
wp-includes/js/wp-emoji-loader.min.js
vendored
2
wp-includes/js/wp-emoji-loader.min.js
vendored
@@ -1 +1 @@
|
||||
!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;if(!g||!g.fillText)return!1;switch(g.textBaseline="top",g.font="600 32px Arial",a){case"flag":return g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3;case"diversity":return g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e;case"simple":return g.fillText(h(55357,56835),0,0),0!==g.getImageData(16,16,1,1).data[0];case"unicode8":return g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
!function(a,b,c){function d(a){var c,d,e,f=b.createElement("canvas"),g=f.getContext&&f.getContext("2d"),h=String.fromCharCode;if(!g||!g.fillText)return!1;switch(g.textBaseline="top",g.font="600 32px Arial",a){case"flag":return g.fillText(h(55356,56806,55356,56826),0,0),f.toDataURL().length>3e3;case"diversity":return g.fillText(h(55356,57221),0,0),c=g.getImageData(16,16,1,1).data,d=c[0]+","+c[1]+","+c[2]+","+c[3],g.fillText(h(55356,57221,55356,57343),0,0),c=g.getImageData(16,16,1,1).data,e=c[0]+","+c[1]+","+c[2]+","+c[3],d!==e;case"simple":return g.fillText(h(55357,56835),0,0),0!==g.getImageData(16,16,1,1).data[0];case"unicode8":return g.fillText(h(55356,57135),0,0),0!==g.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
|
||||
@@ -302,7 +302,7 @@ function wp_debug_mode() {
|
||||
}
|
||||
|
||||
if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
|
||||
ini_set( 'display_errors', 0 );
|
||||
@ini_set( 'display_errors', 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -984,18 +984,14 @@ function auth_redirect() {
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_user_admin() ) {
|
||||
$scheme = 'logged_in';
|
||||
} else {
|
||||
/**
|
||||
* Filter the authentication redirect scheme.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param string $scheme Authentication redirect scheme. Default empty.
|
||||
*/
|
||||
$scheme = apply_filters( 'auth_redirect_scheme', '' );
|
||||
}
|
||||
/**
|
||||
* Filters the authentication redirect scheme.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @param string $scheme Authentication redirect scheme. Default empty.
|
||||
*/
|
||||
$scheme = apply_filters( 'auth_redirect_scheme', '' );
|
||||
|
||||
if ( $user_id = wp_validate_auth_cookie( '', $scheme) ) {
|
||||
/**
|
||||
|
||||
@@ -582,9 +582,6 @@ function get_body_class( $class = '' ) {
|
||||
$classes[] = 'attachment';
|
||||
if ( is_404() )
|
||||
$classes[] = 'error404';
|
||||
if ( is_singular() ) {
|
||||
$classes[] = 'singular';
|
||||
}
|
||||
|
||||
if ( is_single() ) {
|
||||
$post_id = $wp_query->get_queried_object_id();
|
||||
@@ -1468,7 +1465,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
|
||||
* @param bool $icon Whether to include an icon. Default false.
|
||||
* @param string|bool $text If string, will be link text. Default false.
|
||||
*/
|
||||
return apply_filters( 'wp_get_attachment_link', "<a href='$url'>$link_text</a>", $id, $size, $permalink, $icon, $text );
|
||||
return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -179,9 +179,9 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop') );
|
||||
|
||||
// jQuery
|
||||
$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.3' );
|
||||
$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.3' );
|
||||
$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.0' );
|
||||
$scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4' );
|
||||
$scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.12.4' );
|
||||
$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.4.1' );
|
||||
|
||||
// full jQuery UI
|
||||
$scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.4', 1 );
|
||||
@@ -333,7 +333,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), false, 1 );
|
||||
|
||||
$scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.18.1', 1 );
|
||||
$scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.18.1-a', 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'mediaelement', 'mejsL10n', array(
|
||||
'language' => get_bloginfo( 'language' ),
|
||||
'strings' => array(
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
$image_size = 'full'; // Fallback.
|
||||
|
||||
$meta = wp_get_attachment_metadata( $thumbnail_id );
|
||||
if ( is_array( $meta ) ) {
|
||||
if ( ! empty( $meta['sizes'] ) ) {
|
||||
foreach ( $meta['sizes'] as $size => $data ) {
|
||||
if ( $data['width'] / $data['height'] > $aspect_ratio ) {
|
||||
$aspect_ratio = $data['width'] / $data['height'];
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5';
|
||||
$wp_version = '4.5.3';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
@@ -18,7 +18,7 @@ $wp_db_version = 36686;
|
||||
*
|
||||
* @global string $tinymce_version
|
||||
*/
|
||||
$tinymce_version = '4308-20160323';
|
||||
$tinymce_version = '4310-20160418';
|
||||
|
||||
/**
|
||||
* Holds the required PHP version
|
||||
|
||||
@@ -1486,7 +1486,11 @@ class wpdb {
|
||||
}
|
||||
}
|
||||
|
||||
mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
||||
if ( WP_DEBUG ) {
|
||||
mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
||||
} else {
|
||||
@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
|
||||
}
|
||||
|
||||
if ( $this->dbh->connect_errno ) {
|
||||
$this->dbh = null;
|
||||
@@ -1512,7 +1516,11 @@ class wpdb {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
||||
if ( WP_DEBUG ) {
|
||||
$this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
||||
} else {
|
||||
$this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->dbh && $allow_bail ) {
|
||||
|
||||
Reference in New Issue
Block a user