Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 1 addition & 3 deletions includes/class-crypto.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public static function generate_secret_key() {
* @return string|false The decrypted message or false if the message could not be decrypted.
*/
public static function decrypt_message( $message, $secret_key, $nonce ) {

if ( ! $secret_key || ! is_string( $secret_key ) || ! $nonce || ! is_string( $nonce ) ) {
if ( ! $secret_key || ! is_string( $secret_key ) || ! $nonce || ! is_string( $nonce ) || ! is_string( $message ) ) {
return false;
}

Expand All @@ -54,7 +53,6 @@ public static function decrypt_message( $message, $secret_key, $nonce ) {
* @return string|WP_Error The encrypted message or WP_Error if the message could not be encrypted.
*/
public static function encrypt_message( $message, $secret_key, $nonce ) {

if ( ! $secret_key || ! is_string( $secret_key ) || ! $nonce || ! is_string( $nonce ) ) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ public static function init() {
public static function workaround() {
wp_cache_delete( 'dt_media::{$post_id}', 'dt::post' );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,4 @@ public static function filter_subscription_post_args( $post_body, $post ) {
}
return $post_body;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,4 @@ public static function filter_subscription_post_args( $post_body, $post ) {
public static function pull_post( $new_post_id ) {
self::process_attributes( get_post( $new_post_id ) );
}

}
4 changes: 2 additions & 2 deletions includes/incoming-events/class-user-updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public function maybe_update_user() {
Debugger::log( 'Updating user meta: ' . $meta_key );
update_user_meta( $existing_user->ID, $meta_key, $meta_value );
}
}

User_Utils::maybe_sideload_avatar( $existing_user->ID, $data->meta, true );
User_Utils::maybe_sideload_avatar( $existing_user->ID, $data->meta, true );
}
}
}
9 changes: 7 additions & 2 deletions includes/node/class-pulling.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,15 @@ public static function make_request() {
return $response;
}
$response_code = wp_remote_retrieve_response_code( $response );
$response_body = wp_remote_retrieve_body( $response );
if ( 200 !== $response_code ) {
return new \WP_Error( 'newspack-network-node-pulling-error', __( 'Error pulling data from the Hub', 'newspack-network-node' ) );
$error_message = __( 'Error pulling data from the Hub', 'newspack-network-node' );
if ( $response_body ) {
$error_message .= ': ' . $response_body;
}
return new \WP_Error( 'newspack-network-node-pulling-error', $error_message );
}
return wp_remote_retrieve_body( $response );
return $response_body;
}

/**
Expand Down