You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revisions: Prevent fatal error in PHP 8+ when saving a post revision with revisioned non-scalar post meta.
Developed in #10560
Follow-up to [56714].
Props LAPSrj, manhphucofficial, westonruter.
See #20299.
Fixes #64314.
git-svn-id: https://develop.svn.wordpress.org/trunk@61372 602fd350-edb4-49c9-b593-d223f7449a82
$this->assertIsInt( $revision_id_1, 'Expected first revision to be created.' );
974
+
$this->assertCount( 1, wp_get_post_revisions( $post_id ), 'First revision should be created.' );
975
+
$this->assertSame( $initial_favorites, get_post_meta( $revision_id_1, $meta_key, true ), 'Expected first revision post meta to have the initial value.' );
$this->assertIsInt( $revision_id_2, 'Expected second revision to be created.' );
989
+
$this->assertCount( 2, wp_get_post_revisions( $post_id ), 'Second revision should be created after array field change.' );
990
+
$this->assertSame( $updated_favorites, get_post_meta( $revision_id_2, $meta_key, true ), 'Expected second revision post meta to have the updated value.' );
0 commit comments