[wp-trac] [WordPress Trac] #38903: Prevent `update_option()` from updating when the old and new values contain identical objects.
WordPress Trac
noreply at wordpress.org
Thu Dec 8 21:46:13 UTC 2016
#38903: Prevent `update_option()` from updating when the old and new values contain
identical objects.
-------------------------------------------------+-------------------------
Reporter: peterwilsoncc | Owner:
Type: defect (bug) | peterwilsoncc
Priority: normal | Status: assigned
Component: General | Milestone: 4.8
Severity: normal | Version: 2.0
Keywords: early has-patch has-unit-tests | Resolution:
needs-refresh | Focuses:
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):
* keywords: early has-patch => early has-patch has-unit-tests needs-
refresh
* owner: => peterwilsoncc
* status: new => assigned
Comment:
Replying to [comment:5 salcode]:
> I've updated the patch.
Thanks for the refresh.
One gotcha in the patch, `assertFalse` isn't available in the version of
phpunit WP uses when testing PHP 5.6 and earlier. To test for false, the
code is:
{{{#!php
$this->assertSame( false, update_option( 'array_w_object', $array_w_object
) );
}}}
My intention is to commit the code this weekend, I can update the patch
then if you wish.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38903#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list