[wpmu-trac] [WordPress MU Trac] #436: Infinite function call when updating site option

WordPress MU Trac wpmu-trac at lists.automattic.com
Tue Oct 2 08:39:47 GMT 2007


#436: Infinite function call when updating site option
--------------------------+-------------------------------------------------
 Reporter:  dreamer12345  |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:  WPMU 1.0
Component:  component1    |     Version:          
 Severity:  normal        |    Keywords:          
--------------------------+-------------------------------------------------
 Hello,[[BR]]
 [[BR]]
 I've detected an infinite function call when using update_site_option
 function: if the site option already exists in the database but has an
 empty value (i.e. there is an entry in the sitemeta table but the
 meta_value field is empty), update_site_option and add_site_option call
 them each other infinitely.[[BR]]
 [[BR]]
 The reason is that get_site_option checks the existence of a site option
 by testing the meta_value field. If an option is present in the sitemeta
 table but has no value, get_site_option returns false.[[BR]]
 Before update_site_option updates an option, it checks the existence of
 this site option by calling get_site_option, in such a case (record
 present but no value) get_site_option returns false and update_site_option
 calls add_site_option. But add_site_option checks the existence of a site
 option before adding by testing the presence of the entire record (no
 matter meta_value is empty or not). In our case, add_site_option detects
 the blank record and recalls update_site_option resulting in an infinite
 loop.[[BR]]
 [[BR]]
 I discovered this bug by changing the site option WPLANG from the admin
 interface, I reset its value to "Default language" resulting in the
 creation of a site option "WPLANG" with no value (for default). After
 having reset it, I was unable to select another value for WPLANG.[[BR]]
 [[BR]]
 I'm using WPMU 1.2.4 but I checked the sources of 1.2.5a and the bug is
 still present.[[BR]]
 [[BR]]
 [[BR]]
 Thank you for your attention :-)
 [[BR]]
 Frederic.

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/436>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list