[wp-trac] [WordPress Trac] #44956: Prevent `update_network_option()` from updating when the old and new values contain identical objects.
WordPress Trac
noreply at wordpress.org
Mon Oct 8 10:30:56 UTC 2018
#44956: Prevent `update_network_option()` from updating when the old and new values
contain identical objects.
--------------------------------+----------------------------
Reporter: peterwilsoncc | Owner: peterwilsoncc
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.0
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------------+----------------------------
Comment (by bor0):
Code snippet to demonstrate why the proposed patch works:
{{{#!php
<?php
$x = array(
'url' => 'http://src.wordpress-develop.dev/wp-
content/uploads/2016/10/cropped-Blurry-Lights.jpg',
'meta_data' => (object) array(
'attachment_id' => 292,
'height' => 708,
'width' => 1260,
),
);
$y = array(
'url' => 'http://src.wordpress-develop.dev/wp-
content/uploads/2016/10/cropped-Blurry-Lights.jpg',
'meta_data' => (object) array(
'attachment_id' => 292,
'height' => 708,
'width' => 1260,
),
);
var_dump( $x === $y );
var_dump( serialize( $x ) === serialize( $y ) );
}}}
Output:
{{{#!bash
bor0 at boro:~/dev/www/wordpress$ php test.php
bool(false)
bool(true)
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44956#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list