Skip to content

Commit

Permalink
Sniffs
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Dec 30, 2023
1 parent c8c24e9 commit 0f04ca6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/wp-to-twitter-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function wpt_updated_settings() {
if ( ! wp_verify_nonce( $nonce, 'wp-to-twitter-nonce' ) ) {
wp_die( 'XPoster: Security check failed' );
}
// Connect to Twitter
// Connect to Twitter.
if ( isset( $_POST['oauth_settings'] ) ) {
$post = map_deep( $_POST, 'sanitize_text_field' );
$oauth_message = wpt_update_oauth_settings( false, $post );
Expand Down
6 changes: 3 additions & 3 deletions src/wp-to-twitter-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function wpt_update_mastodon_settings( $auth = false, $post = false ) {
wp_die( 'Oops, please try again.' );
}

if ( ! empty( $post['wpt_mastodon_token'] ) && ! empty( $post['wpt_mastodon_instance'] ) ) {
if ( ! empty( $post['wpt_mastodon_token'] ) && ! empty( $post['wpt_mastodon_instance'] ) ) {
$ack = sanitize_text_field( trim( $post['wpt_mastodon_token'] ) );
$acs = sanitize_text_field( trim( $post['wpt_mastodon_instance'] ) );

Expand All @@ -48,9 +48,9 @@ function wpt_update_mastodon_settings( $auth = false, $post = false ) {
'token' => $ack,
'instance' => $acs,
);
$verify = wpt_mastodon_connection( $auth, $validate );
$verify = wpt_mastodon_connection( $auth, $validate );
if ( isset( $verify['username'] ) ) {
$username = sanitize_text_field( stripslashes( $verify['username'] ) );
$username = sanitize_text_field( stripslashes( $verify['username'] ) );
if ( ! $auth ) {
update_option( 'wpt_mastodon_username', $username );
} else {
Expand Down
1 change: 1 addition & 0 deletions src/wpt-post-to-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function wpt_upload_mastodon_media( $connection, $auth, $attachment, $status, $i
'file' => $attachment_data,
'description' => $alt_text,
);

$response = $connection->upload_media( $request );
$media_id = $response['id'];
$status['media_ids[]'] = $media_id;
Expand Down

0 comments on commit 0f04ca6

Please sign in to comment.