Skip to content

Commit

Permalink
Merge pull request #165 from mattwiebe/update/private-code-storage
Browse files Browse the repository at this point in the history
Make token storage taxonomies private
  • Loading branch information
akirk authored Sep 25, 2024
2 parents cfedc80 + 52889e3 commit 9c4ea93
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion includes/class-mastodon-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ private static function get_body_from_php_input() {
// A helpful shim in case this is PHP <=5.6 when php://input could only be accessed once.
static $input;
if ( ! isset( $input ) ) {
$input = file_get_contents( 'php://input' ); // phcs:ignore .
$input = file_get_contents( 'php://input' ); // phpcs:ignore
}

return $input;
Expand Down
2 changes: 1 addition & 1 deletion includes/oauth2/class-access-token-storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct() {
add_action( 'mastodon_api_cron_hook', array( $this, 'cleanupOldCodes' ) );

// Store the access tokens in a taxonomy.
register_taxonomy( self::TAXONOMY, null );
register_taxonomy( self::TAXONOMY, null, array( 'public' => false ) );
foreach ( self::$access_token_data as $key => $type ) {
register_term_meta(
self::TAXONOMY,
Expand Down
2 changes: 1 addition & 1 deletion includes/oauth2/class-authorization-code-storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct() {
add_action( 'mastodon_api_cron_hook', array( $this, 'cleanupOldCodes' ) );

// Store the authorization codes in a taxonomy.
register_taxonomy( self::TAXONOMY, null );
register_taxonomy( self::TAXONOMY, null, array( 'public' => false ) );
foreach ( self::$authorization_code_data as $key => $type ) {
register_term_meta(
self::TAXONOMY,
Expand Down
2 changes: 1 addition & 1 deletion vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function getContent($asResource = false)
}

if (null === $this->content) {
$this->content = file_get_contents('php://input');
$this->content = file_get_contents('php://input'); // phpcs:ignore
}

return $this->content;
Expand Down

0 comments on commit 9c4ea93

Please sign in to comment.