[wp-trac] [WordPress Trac] #52796: Disable auto updates flag logic is reversed

WordPress Trac noreply at wordpress.org
Fri Mar 12 16:51:41 UTC 2021


#52796: Disable auto updates flag logic is reversed
-------------------------------+-----------------------------
 Reporter:  TimothyBlynJacobs  |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Upgrade/Install    |    Version:  5.5
 Severity:  normal             |   Keywords:  needs-patch
  Focuses:                     |
-------------------------------+-----------------------------
 #50824 introduced support for a `disable_autoupdate` flag to prevent an
 auto update from going thru, even if the user had opted into updates for
 that package via the UI.

 https://github.com/WordPress/wordpress-
 develop/blob/380d0445e84861ac0e634701d746b82634790f6f/src/wp-
 admin/includes/class-wp-automatic-updater.php#L177

 It looks like, however, that the logic is reversed. If
 `disable_autoupdate` is set to a `truthy` value so it passed the `! empty`
 check, that value will then be assigned to `$update` directly. Which would
 end up ''enabling'' auto updates for that package, even if the user hadn't
 opted in.

 I think the fix would either be to negate the value of
 `$item->disable_autoupdate`, or perhaps more simply, set it to `false`.

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


More information about the wp-trac mailing list