Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing: force get sharing options when saved options are incorrect #6122

Merged
merged 3 commits into from
Jan 30, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/sharedaddy/sharing-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,14 @@ public function get_blog_services() {
$enabled = get_option( 'sharing-services' );
$services = $this->get_all_services();

if ( !is_array( $options ) )
/**
* Check if options exist and are well formatted.
* This avoids issues on sites with corrupted options.
* @see https://github.com/Automattic/jetpack/issues/6121
*/
if ( ! is_array( $options ) || ! isset( $options['button_style'] ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this do isset( $options['button_style'], $options['global'] ) to test for global as well? Just as we're about to use it in the subsequent line after the conditional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. 4f0e802

$options = array( 'global' => $this->get_global_options() );
}

$global = $options['global'];

Expand Down