[wp-trac] [WordPress Trac] #15988: get_blog_option() behaves differently than get_option()

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 27 00:10:22 UTC 2010


#15988: get_blog_option() behaves differently than get_option()
--------------------------+-----------------------------
 Reporter:  leoj3n        |      Owner:  leoj3n
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Multisite     |    Version:  3.0.3
 Severity:  normal        |   Keywords:  multisite
--------------------------+-----------------------------
 From my testing, get_blog_option() behaves differently than
 get_option().[[BR]]
 [[BR]]
 Both '''update_option''' and '''update_blog_option''' seem to insert the
 option as an array correctly:[[BR]]

 {{{
 update_option('foobar', array(foo, bar));
 update_blog_option($blog_id, 'foobar', array(foo, bar));
 }}}

 The problem appears when attempting to read the option that has been
 stored as an array.[[BR]]
 [[BR]]
 This works, dumping the stored array:

 {{{
 var_dump(get_option('foobar'));
 }}}

 This throws an error:

 {{{
 var_dump(get_blog_option($blog_id, 'foobar'));
 }}}

 The error being: '''Warning: stripslashes() expects parameter 1 to be
 string, array given in C:\xampp\htdocs\wptest\wp-includes\ms-blogs.php on
 line 338'''

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15988>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list