WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 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:

Description

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:

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

Change History (4)

comment:1 nacin3 years ago

  • Keywords reporter-feedback added

Please test 3.1. I remember this being addressed.

comment:2 leoj3n3 years ago

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

Yes, seems to have been addressed in 3.1

comment:3 nacin3 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 nacin3 years ago

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