Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1357 commits
Select commit Hold shift + click to select a range
da31184
Update favicon discovery validation ledger
sirreal Jul 1, 2026
23df3bb
Add state cache blog switch fuzz coverage
sirreal Jul 1, 2026
b847845
Update state cache validation ledger
sirreal Jul 1, 2026
f49c489
Add hierarchical taxonomy term link fuzz coverage
sirreal Jul 1, 2026
6f61e40
Update taxonomy term link validation ledger
sirreal Jul 1, 2026
925224f
Add admin options core page fuzz coverage
sirreal Jul 1, 2026
1905a76
Update admin options validation ledger
sirreal Jul 1, 2026
6afe48a
Add Customizer theme preview fuzz coverage
sirreal Jul 1, 2026
0139faf
Update Customizer theme preview validation ledger
sirreal Jul 1, 2026
69ffaf4
Add auth logout fuzz coverage
sirreal Jul 1, 2026
537b1e9
Update auth logout validation ledger
sirreal Jul 1, 2026
de1da7b
Add cron wrapper fuzz coverage
sirreal Jul 1, 2026
3606d54
Update cron wrapper validation ledger
sirreal Jul 1, 2026
5a6cad2
Add auth login form fuzz coverage
sirreal Jul 1, 2026
427f74f
Update auth login form validation ledger
sirreal Jul 1, 2026
903654a
Add search form fuzz coverage
sirreal Jul 1, 2026
7d9cfcc
Update search form validation ledger
sirreal Jul 1, 2026
6195e53
Add media shortcode fuzz coverage
sirreal Jul 1, 2026
a43c7b4
Update media shortcode validation ledger
sirreal Jul 1, 2026
ead9a7c
Add timezone choice fuzz coverage
sirreal Jul 1, 2026
53f8f3f
Update timezone choice validation ledger
sirreal Jul 1, 2026
d10d0fa
Add option group cache priming fuzz coverage
sirreal Jul 1, 2026
f4039ec
Update option group priming validation ledger
sirreal Jul 1, 2026
94c539d
Add REST batch v1 fuzz coverage
sirreal Jul 1, 2026
0283f6c
Update REST batch validation ledger
sirreal Jul 1, 2026
78b8b78
Add TinyMCE inline editor helper fuzz coverage
sirreal Jul 1, 2026
8b1eb56
Update TinyMCE inline fuzz validation ledger
sirreal Jul 1, 2026
9bfd3cd
Add comment form fuzz coverage
sirreal Jul 1, 2026
091a5ec
Update comment form fuzz validation ledger
sirreal Jul 1, 2026
5883479
Add deep formatting helper fuzz coverage
sirreal Jul 1, 2026
2052988
Update deep formatting fuzz validation ledger
sirreal Jul 1, 2026
07ddf2b
Add multisite signup validation fuzz coverage
sirreal Jul 1, 2026
9982a4a
Update multisite signup fuzz validation ledger
sirreal Jul 1, 2026
a25a6c0
Add HTTP origin helper fuzz coverage
sirreal Jul 1, 2026
c9e8966
Update HTTP origin fuzz validation ledger
sirreal Jul 1, 2026
86ea9ec
Add HTTP encoding helper fuzz coverage
sirreal Jul 1, 2026
ef731e5
Update HTTP encoding fuzz validation ledger
sirreal Jul 1, 2026
fb60b38
Add template link archive navigation fuzz coverage
sirreal Jul 1, 2026
d48cefe
Update template link archive navigation ledger
sirreal Jul 1, 2026
57fe546
Add post embed host script gate fuzz coverage
sirreal Jul 1, 2026
7e6571c
Update post embed host script fuzz ledger
sirreal Jul 1, 2026
9211f6d
Add single-site admin bar callback fuzz coverage
sirreal Jul 1, 2026
69fee16
Update admin bar callback fuzz ledger
sirreal Jul 1, 2026
07a8731
Add comments navigation helper fuzz coverage
sirreal Jul 1, 2026
cc09202
Update comments navigation fuzz ledger
sirreal Jul 1, 2026
9f14ccc
Add page lookup helper fuzz coverage
sirreal Jul 1, 2026
bf29010
Update page lookup fuzz ledger
sirreal Jul 1, 2026
309a336
Add widget editor dependency fuzz coverage
sirreal Jul 1, 2026
6c3b4ce
Update widget editor dependency fuzz ledger
sirreal Jul 1, 2026
02a4952
Add author template helper fuzz coverage
sirreal Jul 1, 2026
650edf5
Update author template fuzz ledger
sirreal Jul 1, 2026
3c10935
Add editor link query fuzz coverage
sirreal Jul 1, 2026
c952bf2
Update editor link query fuzz ledger
sirreal Jul 1, 2026
49115fa
Add built-in block binding fuzz coverage
sirreal Jul 1, 2026
f72e6a3
Add REST site editor revision collection fuzz coverage
sirreal Jul 1, 2026
feef5ba
Merge REST site editor revision collection fuzz coverage
sirreal Jul 1, 2026
32add92
Add REST built-in search handler fuzz coverage
sirreal Jul 1, 2026
cd21f2e
Merge REST built-in search handler fuzz coverage
sirreal Jul 1, 2026
b093964
Add script polyfill generation fuzz coverage
sirreal Jul 1, 2026
758e0ff
Merge script polyfill generation fuzz coverage
sirreal Jul 1, 2026
a893f3d
Add media gallery playlist fuzz coverage
sirreal Jul 1, 2026
7589c5d
Merge media gallery playlist fuzz coverage
sirreal Jul 1, 2026
c8e978a
Add wp_list_comments fuzz coverage
sirreal Jul 1, 2026
beed908
Merge wp_list_comments fuzz coverage
sirreal Jul 1, 2026
07e242d
Add admin nonce failure fuzz coverage
sirreal Jul 10, 2026
ef8e7a5
Merge admin nonce failure fuzz coverage
sirreal Jul 10, 2026
708918f
Merge branch 'trunk' into component-fuzzers
sirreal Jul 10, 2026
2199996
Merge branch 'trunk' into component-fuzzers
sirreal Jul 15, 2026
150431f
Add admin post save fuzz coverage
sirreal Jul 15, 2026
b61a02a
Update component fuzz harness for trunk API drift
sirreal Jul 15, 2026
fe20f9d
Strengthen canonical old-slug fuzz coverage
sirreal Jul 15, 2026
97d8623
Update dashboard for canonical old slug coverage
sirreal Jul 15, 2026
e376a30
Add Customizer publish changeset fuzz coverage
sirreal Jul 15, 2026
485cd81
Add media metadata cover art fuzz coverage
sirreal Jul 15, 2026
06f27de
Add REST media URL sideload fuzz coverage
sirreal Jul 15, 2026
e86f45b
Add cron array persistence fuzz coverage
sirreal Jul 15, 2026
e5d2720
Add plugin theme admin helper fuzz coverage
sirreal Jul 15, 2026
cb3b1b9
Add admin workflow settings notice fuzz coverage
sirreal Jul 15, 2026
f998168
Add block support style callback fuzz coverage
sirreal Jul 15, 2026
49419f0
Add block editor stylesheet fuzz coverage
sirreal Jul 15, 2026
b5f2dc4
Add network media sideload fuzz coverage
sirreal Jul 15, 2026
14a4080
Add REST directory pattern fuzz coverage
sirreal Jul 15, 2026
acd9c38
Add admin edit author meta box fuzz coverage
sirreal Jul 15, 2026
4a52428
Add identity user dropdown fuzz coverage
sirreal Jul 15, 2026
80d063b
Add account reset password fuzz coverage
sirreal Jul 15, 2026
d5e302c
Add customizer control rendering fuzz coverage
sirreal Jul 15, 2026
85e7eca
Add direct plugin theme directory API fuzz coverage
sirreal Jul 15, 2026
a46e88e
Add user insert update filter meta fuzz coverage
sirreal Jul 15, 2026
b576e66
Add user deletion reassignment fuzz coverage
sirreal Jul 15, 2026
24251b8
Add author capability wrapper fuzz coverage
sirreal Jul 15, 2026
8a15c4e
Add site health auto update fuzz coverage
sirreal Jul 15, 2026
1ae1e52
Add date month declension fuzz coverage
sirreal Jul 15, 2026
0b419b8
Add Customizer media control fuzz coverage
sirreal Jul 15, 2026
7013306
Add KSES null and filter lifecycle fuzz coverage
sirreal Jul 15, 2026
2768340
Add recovery mode lifecycle fuzz coverage
sirreal Jul 15, 2026
2c5b15f
Add wpdb charset invalid-text fuzz coverage
sirreal Jul 15, 2026
6f93395
Add XML-RPC taxonomy method fuzz coverage
sirreal Jul 15, 2026
f91d6fc
Add admin dashboard right-now fuzz coverage
sirreal Jul 15, 2026
0397ed8
Add formatting text-link helper fuzz coverage
sirreal Jul 15, 2026
4b0e9bf
Add content lifecycle term update delete fuzz coverage
sirreal Jul 15, 2026
e4984e7
Add admin bulk post edit fuzz coverage
sirreal Jul 16, 2026
c86bb2a
Add bulk edit edge fuzz coverage
sirreal Jul 16, 2026
f1ee1c3
Add bulk edit capability fuzz coverage
sirreal Jul 16, 2026
cf3bd43
Add REST settings dispatch fuzz coverage
sirreal Jul 16, 2026
0659665
Add REST object write dispatch fuzz coverage
sirreal Jul 16, 2026
a255cd1
Add REST object create delete dispatch fuzz coverage
sirreal Jul 16, 2026
862f50f
Add REST object force delete dispatch fuzz coverage
sirreal Jul 16, 2026
8eb5bcd
Add REST media edit post-process dispatch fuzz coverage
sirreal Jul 16, 2026
cc6b2bd
Add REST widgets dispatch mutation fuzz coverage
sirreal Jul 16, 2026
ad8eecd
Add REST application password dispatch fuzz coverage
sirreal Jul 16, 2026
6bdba6a
Add REST revisions autosaves dispatch fuzz coverage
sirreal Jul 16, 2026
27df85a
Add REST taxonomy term mutation fuzz coverage
sirreal Jul 16, 2026
4e70882
Add KSES policy style mutation fuzz coverage
sirreal Jul 16, 2026
50f52fc
Add request lifecycle query canonical fuzz coverage
sirreal Jul 16, 2026
9c643a0
Add taxonomy relationship mutation fuzz coverage
sirreal Jul 16, 2026
07a023e
Add options autoload persistence fuzz coverage
sirreal Jul 16, 2026
d73be49
Add generated REST directory API fuzz coverage
sirreal Jul 16, 2026
86f12f9
Add REST controller default-filter dispatch fuzz coverage
sirreal Jul 16, 2026
146cd16
Add admin workflow list table action matrix fuzz coverage
sirreal Jul 16, 2026
ed54b58
Add media image editor AJAX request matrix fuzz coverage
sirreal Jul 16, 2026
c2d96cd
Add admin media attach action fuzz coverage
sirreal Jul 16, 2026
5585cb4
Add admin media upload dispatch fuzz coverage
sirreal Jul 16, 2026
b8eb350
Add media ingest parent-date upload routing coverage
sirreal Jul 16, 2026
f708ece
Add admin media URL insert dispatch fuzz coverage
sirreal Jul 16, 2026
dfdb126
Add admin media gallery save iframe fuzz coverage
sirreal Jul 16, 2026
7fd365f
Add admin media type iframe fuzz coverage
sirreal Jul 16, 2026
f3f1544
Add admin media upload entry dispatch fuzz coverage
sirreal Jul 16, 2026
2ebd945
Add admin media library gallery tab fuzz coverage
sirreal Jul 16, 2026
da4f732
Add admin media query date filter fuzz coverage
sirreal Jul 16, 2026
3824daf
Add admin media query alias fuzz coverage
sirreal Jul 16, 2026
55cd371
Add admin media date stub edge fuzz coverage
sirreal Jul 16, 2026
4d61947
Add date query scalar projection fuzz coverage
sirreal Jul 16, 2026
1d1a213
Add date query week mode fuzz coverage
sirreal Jul 16, 2026
0841825
Add generated user comment date query fuzz coverage
sirreal Jul 16, 2026
c19bb5f
Add user comment date bound query fuzz coverage
sirreal Jul 16, 2026
bc41878
Add user comment date relation query fuzz coverage
sirreal Jul 16, 2026
c48764a
Add KSES scoped policy matrix fuzz coverage
sirreal Jul 16, 2026
ca92705
Add REST object collection dispatch fuzz coverage
sirreal Jul 16, 2026
5eeef86
Add content lifecycle transition render fuzz coverage
sirreal Jul 16, 2026
05198f5
Add comment moderation workflow fuzz coverage
sirreal Jul 16, 2026
6cc3433
Add media metadata shortcode cache fuzz coverage
sirreal Jul 16, 2026
0b81ea4
Fix REST media upload cache isolation
sirreal Jul 16, 2026
1fbf392
Fix REST directory hook isolation
sirreal Jul 16, 2026
f555ef8
Add KSES style protocol cross-hook fuzzing
sirreal Jul 16, 2026
de172f5
Add KSES semicolon data URL fuzzing
sirreal Jul 16, 2026
0e30765
Add KSES CSS protocol fragment fuzzing
sirreal Jul 16, 2026
aa8263e
Add REST argument error envelope fuzzing
sirreal Jul 16, 2026
867cfce
Add REST controller argument error fuzzing
sirreal Jul 16, 2026
c551c86
Add post mutation projection fuzzing
sirreal Jul 16, 2026
c584f49
Add post slug collision projection fuzzing
sirreal Jul 16, 2026
d6be539
Add post slug history fuzzing
sirreal Jul 16, 2026
33db8ab
Add sample permalink HTML fuzzing
sirreal Jul 16, 2026
7e191ad
Add sample permalink matrix fuzzing
sirreal Jul 16, 2026
2f095c2
Add hierarchical page permalink fuzzing
sirreal Jul 16, 2026
8dfdfdb
Add custom hierarchical permalink fuzzing
sirreal Jul 16, 2026
1752ed8
Add custom hierarchical collection fuzzing
sirreal Jul 16, 2026
70b47af
Add custom hierarchical parent fallback fuzzing
sirreal Jul 16, 2026
bd4b87a
Expand custom hierarchical loop and query-var fuzzing
sirreal Jul 16, 2026
b25229f
Add custom hierarchy loop-break fuzzing
sirreal Jul 16, 2026
7b1365e
Add custom hierarchy cross-parent fuzzing
sirreal Jul 16, 2026
bca7557
Add custom hierarchy parent visibility fuzzing
sirreal Jul 16, 2026
17b34ef
Add custom hierarchy mixed-depth trash fuzzing
sirreal Jul 16, 2026
2e7a815
Add custom hierarchy query untrash fuzzing
sirreal Jul 16, 2026
b5c43ed
Add custom hierarchy status cache fuzzing
sirreal Jul 16, 2026
ea5abb1
Add REST private status capability fuzzing
sirreal Jul 16, 2026
def4d41
Add bulk edit no-publish status fuzzing
sirreal Jul 16, 2026
3722684
Add status query cache fuzzing
sirreal Jul 16, 2026
4455c7b
Add query cache shape parity fuzzing
sirreal Jul 16, 2026
c75118d
Add query cache ordering fuzzing
sirreal Jul 16, 2026
fffdc98
Add query parent normalization fuzzing
sirreal Jul 16, 2026
cca80d7
Add REST parent array normalization fuzzing
sirreal Jul 16, 2026
f6d125d
Add query parent exclusion fuzzing
sirreal Jul 16, 2026
3245ab3
Add query post exclusion fuzzing
sirreal Jul 16, 2026
82b2b42
Add query post name fuzzing
sirreal Jul 16, 2026
5d91b56
Add query author exclusion fuzzing
sirreal Jul 16, 2026
5e33382
Add query author inclusion fuzzing
sirreal Jul 16, 2026
7ced420
Add query author var fuzzing
sirreal Jul 16, 2026
36aa284
Add query post status fuzzing
sirreal Jul 16, 2026
b8344b1
Add query post type fuzzing
sirreal Jul 16, 2026
d9a5644
Add query post inclusion fuzzing
sirreal Jul 16, 2026
38ea9d2
Add query post inclusion ordering fuzzing
sirreal Jul 17, 2026
dcd66a7
Add query slug inclusion ordering fuzzing
sirreal Jul 17, 2026
dd8908f
Add query parent inclusion ordering fuzzing
sirreal Jul 17, 2026
9263911
Add query include exclude precedence fuzzing
sirreal Jul 17, 2026
6075e2e
Add query parent include exclude precedence fuzzing
sirreal Jul 17, 2026
015f22e
Add query author include exclude precedence fuzzing
sirreal Jul 17, 2026
a582e41
Add query author name fuzzing
sirreal Jul 17, 2026
074e954
Add query author name miss fuzzing
sirreal Jul 17, 2026
f5fd127
Add query author name double slash fuzzing
sirreal Jul 17, 2026
cb2a92a
Add query author name collision fuzzing
sirreal Jul 17, 2026
a6022fc
Add query author name include exclude fuzzing
sirreal Jul 17, 2026
a8f88c0
Add query author name legacy author fuzzing
sirreal Jul 17, 2026
f481cb1
Add query author name legacy spacing fuzzing
sirreal Jul 17, 2026
8b82bab
Add query author name legacy noisy fuzzing
sirreal Jul 17, 2026
2d52f7d
Add query author name legacy empty fuzzing
sirreal Jul 17, 2026
90e237b
Add query author name legacy scalar fuzzing
sirreal Jul 17, 2026
eb128c8
Add REST object collection projection fuzzing
sirreal Jul 17, 2026
3f67656
Add REST object route envelope fuzzing
sirreal Jul 17, 2026
6b3620b
Add REST object batch error fuzzing
sirreal Jul 17, 2026
08cf524
Add REST object batch success fuzzing
sirreal Jul 17, 2026
ea033d9
Add REST object batch update fuzzing
sirreal Jul 17, 2026
710cac0
Add REST object batch delete fuzzing
sirreal Jul 17, 2026
e768249
Add REST revision autosave batch gate fuzzing
sirreal Jul 17, 2026
32a62b1
Add built-in REST revision autosave fuzzing
sirreal Jul 17, 2026
640d3c5
Add REST autosave meta mutation fuzzing
sirreal Jul 17, 2026
0dc343f
Add REST autosave negative meta fuzzing
sirreal Jul 17, 2026
1600003
Add REST parent meta contrast fuzzing
sirreal Jul 17, 2026
ea8a334
Add REST sidebar raw widget projection fuzzing
sirreal Jul 17, 2026
1d0cacf
Add REST missing sidebar update diagnostics
sirreal Jul 17, 2026
9c53459
Add REST batch pre-dispatch fuzz coverage
sirreal Jul 17, 2026
11d7a87
Add REST object mixed batch update coverage
sirreal Jul 17, 2026
1633272
Add KSES post deep fuzz coverage
sirreal Jul 17, 2026
a70a3d5
Add REST object mixed create batch fuzzing
sirreal Jul 17, 2026
ec71642
Add REST object require-all mixed create fuzzing
sirreal Jul 17, 2026
e283897
Add REST batch malformed path fuzzing
sirreal Jul 17, 2026
89c7386
Add generated KSES helper contract fuzzing
sirreal Jul 17, 2026
1bedb48
Add security redirect dispatch fuzzing
sirreal Jul 17, 2026
58cdd7f
Add REST batch no-route child fuzzing
sirreal Jul 17, 2026
4698db7
Add KSES pre-hook lifecycle fuzzing
sirreal Jul 17, 2026
4070c9c
Add KSES reentrant allowed-html diagnostics
sirreal Jul 17, 2026
34e0824
Add security nonce hook edge fuzzing
sirreal Jul 17, 2026
79fa907
Add REST batch request schema fuzzing
sirreal Jul 17, 2026
4da7c9d
Add REST menu location argument fuzzing
sirreal Jul 17, 2026
78c2b86
Add REST plugin theme argument fuzzing
sirreal Jul 17, 2026
eb57afd
Add REST plugin theme dispatch fuzzing
sirreal Jul 17, 2026
45e4d1c
Add REST plugin theme item fuzzing
sirreal Jul 17, 2026
8d93a54
Add REST search coercion fuzzing
sirreal Jul 17, 2026
63ff560
Add REST search field envelope fuzzing
sirreal Jul 17, 2026
ad28b72
Merge branch 'component-fuzz-rest-search-fields' into component-fuzzers
sirreal Jul 17, 2026
a550a34
Add admin referer hook edge fuzzing
sirreal Jul 17, 2026
59b51de
Merge branch 'component-fuzz-security-admin-referer' into component-f…
sirreal Jul 17, 2026
4c8b5d5
Add REST block renderer field fuzzing
sirreal Jul 17, 2026
ed695c1
Merge branch 'component-fuzz-rest-block-renderer-fields' into compone…
sirreal Jul 17, 2026
090fa4a
Add REST sidebar route envelope fuzzing
sirreal Jul 17, 2026
5e47b94
Merge branch 'component-fuzz-rest-sidebar-fields' into component-fuzzers
sirreal Jul 17, 2026
adab03a
Add account reset request fuzzing
sirreal Jul 17, 2026
e4aadb6
Merge branch 'component-fuzz-account-reset-request' into component-fu…
sirreal Jul 17, 2026
0a981d4
Add auth redirect fuzzing
sirreal Jul 17, 2026
83cf49b
Merge branch 'component-fuzz-auth-redirect' into component-fuzzers
sirreal Jul 17, 2026
7e88052
Add cron pre-filter failure fuzzing
sirreal Jul 17, 2026
4d4bd72
Merge branch 'component-fuzz-cron-pre-filter-errors' into component-f…
sirreal Jul 17, 2026
6d2143f
Add frontend URL prefixer fuzzing
sirreal Jul 17, 2026
6cd5b93
Merge branch 'component-fuzz-frontend-url-prefixer' into component-fu…
sirreal Jul 17, 2026
4928128
Add mail emoji wrapper fuzzing
sirreal Jul 17, 2026
ec62528
Merge branch 'component-fuzz-mail-emoji-wrapper' into component-fuzzers
sirreal Jul 17, 2026
d50e4fd
Add feed anchor link fuzzing
sirreal Jul 17, 2026
4da849f
Merge branch 'component-fuzz-feed-anchor-links' into component-fuzzers
sirreal Jul 17, 2026
0edae51
Add importer get_page fuzzing
sirreal Jul 17, 2026
2db13c4
Merge branch 'component-fuzz-importer-get-page' into component-fuzzers
sirreal Jul 17, 2026
0ff9a66
Merge remote-tracking branch 'upstream/trunk' into component-fuzzers
sirreal Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function column_last_ip( $item ) {
if ( empty( $item['last_ip'] ) ) {
echo '—';
} else {
echo $item['last_ip'];
echo esc_html( $item['last_ip'] );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private function create_psr_response( array $wp_response ): ResponseInterface {
}
}

if ( ! empty( $body ) ) {
if ( '' !== $body ) {
$stream = $this->stream_factory->createStream( $body );
$response = $response->withBody( $stream );
}
Expand Down
14 changes: 12 additions & 2 deletions src/wp-includes/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,18 @@ function _get_block_template_file( $template_type, $slug ) {
);
foreach ( $themes as $theme_slug => $theme_dir ) {
$template_base_paths = get_block_theme_folders( $theme_slug );
$file_path = $theme_dir . '/' . $template_base_paths[ $template_type ] . '/' . $slug . '.html';
if ( file_exists( $file_path ) ) {
$template_base_path = $theme_dir . '/' . $template_base_paths[ $template_type ];
$file_path = $template_base_path . '/' . $slug . '.html';
$real_base_path = realpath( $template_base_path );
$real_file_path = realpath( $file_path );
if (
false !== $real_base_path &&
false !== $real_file_path &&
str_starts_with(
wp_normalize_path( $real_file_path ),
trailingslashit( wp_normalize_path( $real_base_path ) )
)
) {
$new_template_item = array(
'slug' => $slug,
'path' => $file_path,
Expand Down
77 changes: 70 additions & 7 deletions src/wp-includes/class-wp-block-metadata-registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class WP_Block_Metadata_Registry {
* @return bool True if the collection was registered successfully, false otherwise.
*/
public static function register_collection( $path, $manifest ) {
$path = rtrim( wp_normalize_path( $path ), '/' );
$path = self::normalize_collection_path( $path );

$collection_roots = self::get_default_collection_roots();

Expand Down Expand Up @@ -112,7 +112,7 @@ public static function register_collection( $path, $manifest ) {
$collection_roots = array_unique(
array_map(
static function ( $allowed_root ) {
return rtrim( wp_normalize_path( $allowed_root ), '/' );
return self::normalize_collection_path( $allowed_root );
},
$collection_roots
)
Expand Down Expand Up @@ -161,7 +161,7 @@ static function ( $allowed_root ) {
* @return array|null The block metadata for the block, or null if not found.
*/
public static function get_metadata( $file_or_folder ) {
$file_or_folder = wp_normalize_path( $file_or_folder );
$file_or_folder = self::normalize_collection_path( $file_or_folder );

$path = self::find_collection_path( $file_or_folder );
if ( ! $path ) {
Expand Down Expand Up @@ -196,7 +196,7 @@ public static function get_metadata( $file_or_folder ) {
* @return string[] List of block metadata file paths, or an empty array if the given `$path` is invalid.
*/
public static function get_collection_block_metadata_files( $path ) {
$path = rtrim( wp_normalize_path( $path ), '/' );
$path = self::normalize_collection_path( $path );

if ( ! isset( self::$collections[ $path ] ) ) {
_doing_it_wrong(
Expand All @@ -223,6 +223,56 @@ static function ( $block_name ) use ( $path ) {
);
}

/**
* Normalizes a collection path and collapses dot segments.
*
* @since 7.1.0
*
* @param string $path File or directory path.
* @return string Normalized path without trailing slashes.
*/
private static function normalize_collection_path( $path ) {
$path = wp_normalize_path( $path );

$prefix = '';
if ( preg_match( '#^([A-Za-z][A-Za-z0-9+.-]*://)(.*)$#', $path, $matches ) ) {
$prefix = $matches[1];
$path = $matches[2];
} elseif ( str_starts_with( $path, '//' ) ) {
$prefix = '//';
$path = substr( $path, 2 );
}

$drive = '';
if ( preg_match( '#^[A-Za-z]:#', $path, $matches ) ) {
$drive = $matches[0];
$path = substr( $path, 2 );
}

$is_absolute = str_starts_with( $path, '/' );
$parts = array();

foreach ( explode( '/', $path ) as $part ) {
if ( '' === $part || '.' === $part ) {
continue;
}
if ( '..' === $part ) {
if ( array() !== $parts && '..' !== end( $parts ) ) {
array_pop( $parts );
continue;
}
if ( ! $is_absolute ) {
$parts[] = $part;
}
continue;
}
$parts[] = $part;
}

$normalized = ( $is_absolute ? '/' : '' ) . implode( '/', $parts );
return $prefix . rtrim( $drive . $normalized, '/' );
}

/**
* Finds the collection path for a given file or folder.
*
Expand All @@ -238,20 +288,33 @@ private static function find_collection_path( $file_or_folder ) {

// Check the last matched collection first, since block registration usually happens in batches per plugin or theme.
$path = rtrim( $file_or_folder, '/' );
if ( self::$last_matched_collection && str_starts_with( $path, self::$last_matched_collection ) ) {
if ( self::$last_matched_collection && self::is_same_or_child_path( $path, self::$last_matched_collection ) ) {
return self::$last_matched_collection;
}

$collection_paths = array_keys( self::$collections );
foreach ( $collection_paths as $collection_path ) {
if ( str_starts_with( $path, $collection_path ) ) {
if ( self::is_same_or_child_path( $path, $collection_path ) ) {
self::$last_matched_collection = $collection_path;
return $collection_path;
}
}
return null;
}

/**
* Checks whether a path is equal to or inside another path.
*
* @since 7.1.0
*
* @param string $path Normalized path.
* @param string $base_path Normalized base path.
* @return bool True if the path is the base path or a child path, false otherwise.
*/
private static function is_same_or_child_path( $path, $base_path ) {
return $path === $base_path || str_starts_with( $path, $base_path . '/' );
}

/**
* Checks if metadata exists for a given block name in a specific collection.
*
Expand Down Expand Up @@ -317,7 +380,7 @@ private static function is_valid_collection_path( $path, $collection_roots ) {
}

// If the path is a parent path of any of the roots, it is invalid.
if ( str_starts_with( $allowed_root, $path ) ) {
if ( self::is_same_or_child_path( $allowed_root, $path ) ) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-token-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public function to_array(): array {
}

foreach ( $this->large_words as $index => $group ) {
$prefix = substr( $this->groups, $index * ( $this->key_length + 1 ), 2 );
$prefix = substr( $this->groups, $index * ( $this->key_length + 1 ), $this->key_length );
$group_length = strlen( $group );
$at = 0;
while ( $at < $group_length ) {
Expand Down
19 changes: 19 additions & 0 deletions src/wp-includes/class-wp-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,27 @@ public static function get_data_by( $field, $value ) {
}
}

if ( 'email' === $field ) {
$users = $wpdb->get_results(
$wpdb->prepare(
"SELECT * FROM $wpdb->users WHERE user_email = %s",
$value
)
);

foreach ( $users as $user ) {
if ( 0 === strcasecmp( $user->user_email, $value ) ) {
update_user_caches( $user );
return $user;
}
}

return false;
}

$user = $wpdb->get_row(
$wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- The column name is selected by the hardcoded switch above.
"SELECT * FROM $wpdb->users WHERE $db_field = %s LIMIT 1",
$value
)
Expand Down
79 changes: 69 additions & 10 deletions src/wp-includes/fonts/class-wp-font-face.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,7 @@ private function build_font_face_css( array $font_face ) {
* Wrap font-family in quotes if it contains spaces
* and is not already wrapped in quotes.
*/
if (
str_contains( $font_face['font-family'], ' ' ) &&
! str_contains( $font_face['font-family'], '"' ) &&
! str_contains( $font_face['font-family'], "'" )
) {
$font_face['font-family'] = '"' . $font_face['font-family'] . '"';
}
$font_face['font-family'] = $this->compile_font_family( $font_face['font-family'] );

foreach ( $font_face as $key => $value ) {
// Compile the "src" parameter.
Expand All @@ -338,6 +332,47 @@ private function build_font_face_css( array $font_face ) {
return $css;
}

/**
* Compiles the `font-family` into valid CSS.
*
* @since 6.4.0
*
* @param string $value Value to process.
* @return string The CSS.
*/
private function compile_font_family( $value ) {
if ( $this->font_family_needs_quotes( $value ) ) {
return '"' . $this->escape_css_string( $value, '"' ) . '"';
}

return $value;
}

/**
* Checks whether a font family value should be quoted.
*
* @since 6.4.0
*
* @param string $value Value to process.
* @return bool Whether the font family value should be quoted.
*/
private function font_family_needs_quotes( $value ) {
if (
str_contains( $value, ';' ) ||
str_contains( $value, '{' ) ||
str_contains( $value, '}' ) ||
str_contains( $value, '/*' ) ||
str_contains( $value, '*/' ) ||
preg_match( '/[\x00-\x1F\x7F]/', $value )
) {
return true;
}

return str_contains( $value, ' ' ) &&
! str_contains( $value, '"' ) &&
! str_contains( $value, "'" );
}

/**
* Compiles the `src` into valid CSS.
*
Expand All @@ -350,15 +385,39 @@ private function compile_src( array $value ) {
$src = '';

foreach ( $value as $item ) {
$src .= ( 'data' === $item['format'] )
? ", url({$item['url']})"
: ", url('{$item['url']}') format('{$item['format']}')";
$src .= ", url('" . $this->escape_css_string( $item['url'], "'" ) . "')";

if ( 'data' !== $item['format'] ) {
$src .= " format('" . $this->escape_css_string( $item['format'], "'" ) . "')";
}
}

$src = ltrim( $src, ', ' );
return $src;
}

/**
* Escapes a value for use in a quoted CSS string.
*
* @since 6.4.0
*
* @param string $value Value to process.
* @param string $quote Quote character wrapping the CSS string.
* @return string Escaped CSS string content.
*/
private function escape_css_string( $value, $quote ) {
$value = str_replace( '\\', '\\\\', $value );
$value = str_replace( $quote, '\\' . $quote, $value );

return preg_replace_callback(
'/[\x00-\x1F\x7F]/',
static function ( $matches ) {
return '\\' . strtoupper( dechex( ord( $matches[0] ) ) ) . ' ';
},
$value
);
}

/**
* Compiles the font variation settings.
*
Expand Down
5 changes: 4 additions & 1 deletion src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,9 @@ function sanitize_file_name( $filename ) {
* @see https://www.php.net/manual/en/regexp.reference.unicode.php
*/
$filename = preg_replace( '#\p{Zs}#siu', ' ', $filename );
if ( null === $filename ) {
$filename = '';
}
}

/**
Expand Down Expand Up @@ -3209,7 +3212,7 @@ function make_clickable( $text ) {
$ret = preg_replace_callback( $url_clickable, '_make_url_clickable_cb', $ret );

$ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
$ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret );
$ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+(?:xn--[0-9a-z-]*[0-9a-z]|[0-9a-z]{2,}))(?![0-9a-z-])#i', '_make_email_clickable_cb', $ret );

$ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
$r .= $ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function send(Request $request, ?RequestOptions $options = null): Respons
} else {
$psr7Response = $this->client->sendRequest($psr7Request);
}
} catch (NetworkException $e) {
throw NetworkException::fromPsr18NetworkException($psr7Request, $e);
} catch (\WordPress\AiClientDependencies\Psr\Http\Client\NetworkExceptionInterface $e) {
throw NetworkException::fromPsr18NetworkException($psr7Request, $e);
} catch (\WordPress\AiClientDependencies\Psr\Http\Client\ClientExceptionInterface $e) {
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
try {
$phpmailer->setFrom( $from_email, $from_name, false );
} catch ( PHPMailer\PHPMailer\Exception $e ) {
$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' );
$mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments', 'embeds' );
$mail_error_data['phpmailer_exception_code'] = $e->getCode();

/** This filter is documented in wp-includes/pluggable.php */
Expand Down
9 changes: 9 additions & 0 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,15 @@ function register_post_type( $post_type, $args = array() ) {
return new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) );
}

// Re-registration replaces the object; clean side effects from the old object first.
if ( isset( $wp_post_types[ $post_type ] ) && $wp_post_types[ $post_type ] instanceof WP_Post_Type && ! $wp_post_types[ $post_type ]->_builtin ) {
$wp_post_types[ $post_type ]->remove_supports();
$wp_post_types[ $post_type ]->remove_rewrite_rules();
$wp_post_types[ $post_type ]->unregister_meta_boxes();
$wp_post_types[ $post_type ]->remove_hooks();
$wp_post_types[ $post_type ]->unregister_taxonomies();
}

$post_type_object = new WP_Post_Type( $post_type, $args );
$post_type_object->add_supports();
$post_type_object->add_rewrite_rules();
Expand Down
Loading
Loading