[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 Sep 17 05:45:23 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              |   Keywords:  needs-patch
  Focuses:                      |
--------------------------------+---------------------------
 When an object is included in an option, passing an unchanged value to
 `update_network_option` will trigger an `UPDATE` query.

 Given the data below, the `meta_data` will have a different resource ID
 for the old and new values. `$value === $old_value` will always evaluate
 untrue and the database will be updated and the caches cleared.

 {{{
 array(2) {
   ["url"]=>
   string(85) "http://src.wordpress-develop.dev/wp-content/uploads/2016/10
 /cropped-Blurry-Lights.jpg"
   ["meta_data"]=>
   object(stdClass)#370 (3) {
     ["attachment_id"]=>
     int(292)
     ["height"]=>
     int(708)
     ["width"]=>
     int(1260)
   }
 }
 }}}

 Followup from #38903 fixed in [39564].

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44956>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list