[wp-trac] [WordPress Trac] #61029: Multisite state 'Delete' can only have a value of 1or 0. Not 2. So why is 2 mentioned in the code?

WordPress Trac noreply at wordpress.org
Wed Apr 17 22:05:53 UTC 2024


#61029: Multisite state 'Delete' can only have a value of 1or 0. Not 2. So why is 2
mentioned in the code?
---------------------------+-----------------------------
 Reporter:  ignatiusjeroe  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:
 Severity:  normal         |   Keywords:
  Focuses:  multisite      |
---------------------------+-----------------------------
 In function ms_site_check() @ 103 "if ( '2' == $blog->deleted )" the code
 checks if the site deleted state has a value of 2. But in wp-admin/network
 /site-info.php from line 74 to 82 the code checks the value of all states
 and either assigns them with a 1 or 0. I havent found anywhere in the
 source code were any site state could be assigned a value of 2.

 So the snippet "if ( '2' == $blog->deleted )" makes no sense. Sure you can
 alter the state value using wp_update_site(). But that is not the answers
 since whenever the site is updated on wp-admin/network/site-info.php the
 values are validated prior to saving the the dB. And like i said, the only
 valid values are 1 or 0.  ms_site_check() should be edited. The drop-in in
 the if-statement is rendered unusable cause the if-statement will fail
 every time.

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


More information about the wp-trac mailing list