Skip to content

Commit

Permalink
Merge pull request #2067 from rtCamp/fix/import-json-error
Browse files Browse the repository at this point in the history
Refactor RTMediaAdmin.php to handle JSON decoding error
  • Loading branch information
the-hercules authored Sep 10, 2024
2 parents 975da7a + 04f3371 commit 9d7991c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/admin/RTMediaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ public function import_settings( $file_path ) {
wp_send_json( $response );
}

$settings_data = json_decode( $settings_data_json, true );
$settings_data = $settings_data_json;
if ( ! is_array( $settings_data ) || empty( $settings_data['rtm_key'] ) ) {
$response['rtm_response'] = 'error';
$response['rtm_response_msg'] = esc_html__( 'Invalid JSON Supplied!', 'buddypress-media' );
Expand Down

0 comments on commit 9d7991c

Please sign in to comment.