Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#15988 closed defect (bug) (duplicate)

get_blog_option() behaves differently than get_option()

Reported by: leoj3n Owned by: leoj3n
Milestone: Priority: normal
Severity: normal Version: 3.0.3
Component: Multisite Keywords: reporter-feedback
Focuses: multisite Cc:


From my testing, get_blog_option() behaves differently than get_option().

Both update_option and update_blog_option seem to insert the option as an array correctly:

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.

This works, dumping the stored array:


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

Change History (4)

#1 @nacin
9 years ago

  • Keywords reporter-feedback added

Please test 3.1. I remember this being addressed.

#2 @leoj3n
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Yes, seems to have been addressed in 3.1

#3 @nacin
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#4 @nacin
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.