Skip to content

Commit 647bc04

Browse files
committed
Restore: Sync Gutenberg @ 8c78d87453509661a9f28f978ba2c242d515563b
See changelog in 21d3c57
2 parents c264b99 + 21d3c57 commit 647bc04

File tree

63 files changed

+2101
-565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2101
-565
lines changed

src/js/_enqueues/wp/util.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ window.wp = window.wp || {};
3636
};
3737

3838
return function ( data ) {
39-
if ( ! document.getElementById( 'tmpl-' + id ) ) {
39+
var el = document.querySelector( 'script#tmpl-' + id );
40+
if ( ! el ) {
4041
throw new Error( 'Template not found: ' + '#tmpl-' + id );
4142
}
42-
compiled = compiled || _.template( $( '#tmpl-' + id ).html(), options );
43+
compiled = compiled || _.template( $( el ).html(), options );
4344
return compiled( data );
4445
};
4546
});

src/wp-admin/css/colors/_admin.scss

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,12 @@ input[type="checkbox"]:checked {
8888
border-color: var(--wp-admin-theme-color);
8989
}
9090

91-
input[type=checkbox]:checked::before {
92-
content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27#{url-friendly-colour(variables.$form-checked)}%27%2F%3E%3C%2Fsvg%3E");
93-
content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27#{url-friendly-colour(variables.$form-checked)}%27%2F%3E%3C%2Fsvg%3E") / '';
94-
}
95-
96-
// Checkbox checkmark - white for visibility on theme color background
97-
input[type="checkbox"]:checked::before {
98-
content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E") / '';
99-
}
100-
10191
// Radio checked state - uses theme color
10292
input[type="radio"]:checked {
10393
background: var(--wp-admin-theme-color);
10494
border-color: var(--wp-admin-theme-color);
10595
}
10696

107-
// Radio dot - white for visibility on theme color background
108-
input[type="radio"]:checked::before {
109-
background: tokens.$white;
110-
}
111-
11297
.wp-core-ui input[type="reset"]:hover,
11398
.wp-core-ui input[type="reset"]:active {
11499
color: variables.$link-focus;

src/wp-admin/css/common.css

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,8 @@ img.emoji {
809809
.notice-dismiss:before {
810810
background: none;
811811
color: #1e1e1e;
812-
content: "\f153";
813-
content: "\f153" / '';
812+
content: "\f335";
813+
content: "\f335" / '';
814814
display: block;
815815
font: normal 20px/1 dashicons;
816816
height: 1em;
@@ -1380,6 +1380,12 @@ th.action-links {
13801380
}
13811381
}
13821382

1383+
@media only screen and (max-width: 1250px) {
1384+
.wp-filter:has(.plugin-install-search) .search-form {
1385+
margin: 11px 0;
1386+
}
1387+
}
1388+
13831389
@media only screen and (max-width: 1120px) {
13841390
.filter-drawer {
13851391
border-bottom: 1px solid #f0f0f1;
@@ -2263,8 +2269,9 @@ html.wp-toolbar {
22632269
color: #a7aaad;
22642270
}
22652271

2266-
.sortable-placeholder {
2272+
.sortable-placeholder:not(.empty-container .sortable-placeholder) {
22672273
border: 1px dashed #c3c4c7;
2274+
border-radius: 8px;
22682275
margin-bottom: 20px;
22692276
}
22702277

src/wp-admin/css/dashboard.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
}
8484

8585
.is-dragging-metaboxes #dashboard-widgets .postbox-container .empty-container {
86-
outline: 2px dashed rgb(0, 0, 0, 0.15);
8786
background: rgb(0, 0, 0, 0.01);
8887
}
8988

src/wp-admin/includes/ajax-actions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ function wp_ajax_save_widget() {
23822382
*/
23832383
do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
23842384

2385-
/** This action is documented in wp-admin/widgets.php */
2385+
/** This action is documented in wp-admin/widgets-form.php */
23862386
do_action( 'sidebar_admin_setup' );
23872387

23882388
$id_base = wp_unslash( $_POST['id_base'] );
@@ -2410,7 +2410,7 @@ function wp_ajax_save_widget() {
24102410
'delete_widget' => '1',
24112411
);
24122412

2413-
/** This action is documented in wp-admin/widgets.php */
2413+
/** This action is documented in wp-admin/widgets-form.php */
24142414
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
24152415

24162416
} elseif ( $settings && preg_match( '/__i__|%i%/', key( $settings ) ) ) {
@@ -2486,7 +2486,7 @@ function wp_ajax_delete_inactive_widgets() {
24862486
do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
24872487
/** This action is documented in wp-admin/includes/ajax-actions.php */
24882488
do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
2489-
/** This action is documented in wp-admin/widgets.php */
2489+
/** This action is documented in wp-admin/widgets-form.php */
24902490
do_action( 'sidebar_admin_setup' );
24912491

24922492
$sidebars_widgets = wp_get_sidebars_widgets();

src/wp-admin/includes/class-walker-nav-menu-checklist.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur
116116
$output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="' . esc_attr( $menu_item->object ) . '" />';
117117
$output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="' . esc_attr( $menu_item->menu_item_parent ) . '" />';
118118
$output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="' . esc_attr( $menu_item->type ) . '" />';
119-
$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr( $menu_item->title ) . '" />';
119+
$output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . htmlspecialchars( $menu_item->title, ENT_QUOTES ) . '" />';
120120
$output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_url( $menu_item->url ) . '" />';
121121
$output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr( $menu_item->target ) . '" />';
122-
$output .= '<input type="hidden" class="menu-item-attr-title" name="menu-item[' . $possible_object_id . '][menu-item-attr-title]" value="' . esc_attr( $menu_item->attr_title ) . '" />';
123-
$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr( implode( ' ', $menu_item->classes ) ) . '" />';
124-
$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . esc_attr( $menu_item->xfn ) . '" />';
122+
$output .= '<input type="hidden" class="menu-item-attr-title" name="menu-item[' . $possible_object_id . '][menu-item-attr-title]" value="' . htmlspecialchars( $menu_item->attr_title, ENT_QUOTES ) . '" />';
123+
$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . htmlspecialchars( implode( ' ', $menu_item->classes ), ENT_QUOTES ) . '" />';
124+
$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . htmlspecialchars( $menu_item->xfn, ENT_QUOTES ) . '" />';
125125
}
126126
}

src/wp-admin/includes/class-walker-nav-menu-edit.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur
203203
<p class="description description-wide">
204204
<label for="edit-menu-item-title-<?php echo $item_id; ?>">
205205
<?php _e( 'Navigation Label' ); ?><br />
206-
<input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->title ); ?>" />
206+
<input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( $menu_item->title, ENT_QUOTES ); ?>" />
207207
</label>
208208
</p>
209209
<p class="field-title-attribute field-attr-title description description-wide">
210210
<label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
211211
<?php _e( 'Title Attribute' ); ?><br />
212-
<input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->post_excerpt ); ?>" />
212+
<input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( $menu_item->post_excerpt, ENT_QUOTES ); ?>" />
213213
</label>
214214
</p>
215215
<p class="field-link-target description">
@@ -222,20 +222,20 @@ public function start_el( &$output, $data_object, $depth = 0, $args = null, $cur
222222
<p class="field-css-classes description description-thin">
223223
<label for="edit-menu-item-classes-<?php echo $item_id; ?>">
224224
<?php _e( 'CSS Classes (optional)' ); ?><br />
225-
<input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( implode( ' ', $menu_item->classes ) ); ?>" />
225+
<input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( implode( ' ', $menu_item->classes ), ENT_QUOTES ); ?>" />
226226
</label>
227227
</p>
228228
<p class="field-xfn description description-thin">
229229
<label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
230230
<?php _e( 'Link Relationship (XFN)' ); ?><br />
231-
<input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $menu_item->xfn ); ?>" />
231+
<input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo htmlspecialchars( $menu_item->xfn, ENT_QUOTES ); ?>" />
232232
</label>
233233
</p>
234234
</div>
235235
<p class="field-description description description-wide">
236236
<label for="edit-menu-item-description-<?php echo $item_id; ?>">
237237
<?php _e( 'Description' ); ?><br />
238-
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $menu_item->description ); // textarea_escaped ?></textarea>
238+
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_textarea( $menu_item->description ); // textarea_escaped ?></textarea>
239239
<span class="description"><?php _e( 'The description will be displayed in the menu if the active theme supports it.' ); ?></span>
240240
</label>
241241
</p>

src/wp-admin/includes/file.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,11 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
18951895
continue;
18961896
}
18971897

1898+
// Don't extract invalid files:
1899+
if ( 0 !== validate_file( $archive_file['filename'] ) ) {
1900+
continue;
1901+
}
1902+
18981903
$uncompressed_size += $archive_file['size'];
18991904

19001905
$needed_dirs[] = $to . untrailingslashit( $archive_file['folder'] ? $archive_file['filename'] : dirname( $archive_file['filename'] ) );
@@ -1953,7 +1958,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
19531958
}
19541959
}
19551960

1956-
/** This filter is documented in src/wp-admin/includes/file.php */
1961+
/** This filter is documented in wp-admin/includes/file.php */
19571962
$pre = apply_filters( 'pre_unzip_file', null, $file, $to, $needed_dirs, $required_space );
19581963

19591964
if ( null !== $pre ) {
@@ -1980,7 +1985,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
19801985
}
19811986
}
19821987

1983-
/** This action is documented in src/wp-admin/includes/file.php */
1988+
/** This filter is documented in wp-admin/includes/file.php */
19841989
$result = apply_filters( 'unzip_file', true, $file, $to, $needed_dirs, $required_space );
19851990

19861991
unset( $needed_dirs );

src/wp-admin/includes/ms.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
9797
if ( $drop ) {
9898
wp_delete_site( $blog_id );
9999
} else {
100-
/** This action is documented in wp-includes/ms-blogs.php */
100+
/** This action is documented in wp-includes/ms-site.php */
101101
do_action_deprecated( 'delete_blog', array( $blog_id, false ), '5.1.0' );
102102

103103
$users = get_users(
@@ -116,7 +116,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
116116

117117
update_blog_status( $blog_id, 'deleted', 1 );
118118

119-
/** This action is documented in wp-includes/ms-blogs.php */
119+
/** This action is documented in wp-includes/ms-site.php */
120120
do_action_deprecated( 'deleted_blog', array( $blog_id, false ), '5.1.0' );
121121
}
122122

src/wp-includes/ID3/getid3.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
if (!defined('GETID3_LIBXML_OPTIONS') && defined('LIBXML_VERSION')) {
1515
if (LIBXML_VERSION >= 20621) {
16-
define('GETID3_LIBXML_OPTIONS', LIBXML_NOENT | LIBXML_NONET | LIBXML_NOWARNING | LIBXML_COMPACT);
16+
define('GETID3_LIBXML_OPTIONS', LIBXML_NONET | LIBXML_NOWARNING | LIBXML_COMPACT);
1717
} else {
18-
define('GETID3_LIBXML_OPTIONS', LIBXML_NOENT | LIBXML_NONET | LIBXML_NOWARNING);
18+
define('GETID3_LIBXML_OPTIONS', LIBXML_NONET | LIBXML_NOWARNING);
1919
}
2020
}
2121

0 commit comments

Comments
 (0)