From 48140623847830945b1d4fe09468cf0a989b23f3 Mon Sep 17 00:00:00 2001 From: Igor Rozum Date: Fri, 7 Aug 2026 19:16:02 -0400 Subject: [PATCH] Query: Add unit test for redirect_guess_404_permalink() post_type array leak fix --- tests/phpunit/tests/canonical.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/canonical.php b/tests/phpunit/tests/canonical.php index 886b09312910e..1980ed0e5c530 100644 --- a/tests/phpunit/tests/canonical.php +++ b/tests/phpunit/tests/canonical.php @@ -378,6 +378,7 @@ public function data_redirect_guess_404_permalink_with_custom_statuses() { * * @ticket 43056 * @ticket 59795 + * @ticket 44964 * * @dataProvider data_redirect_guess_404_permalink_post_types */ @@ -413,6 +414,10 @@ public function data_redirect_guess_404_permalink_post_types() { 'original_url' => '/?name=private-cpt-po&post_type[]=wp_tests_private', 'expected' => '/?name=private-cpt-po&post_type[]=wp_tests_private', ), + 'do not leak private post type mixed in with a public one' => array( + 'original_url' => '/?name=private-cpt-po&post_type[]=page&post_type[]=wp_tests_private', + 'expected' => '/?name=private-cpt-po&post_type[]=page&post_type[]=wp_tests_private', + ), ); }