Skip to content

Commit

Permalink
Use static number instead of class constant
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Apr 27, 2024
1 parent 4907e58 commit fc16a6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/WP_CLI/CommandWithUpgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,10 @@ public function get_the_latest_github_version( $repo_slug ) {
$body = \wp_remote_retrieve_body( $response );
$decoded_body = json_decode( $body );

if ( wp_remote_retrieve_response_code( $response ) === \WP_Http::FORBIDDEN ) {
// WP_Http::FORBIDDEN doesn't exist in WordPress 3.7
if ( 403 === wp_remote_retrieve_response_code( $response ) ) {
return new \WP_Error(
\WP_Http::FORBIDDEN,
403,
$this->build_rate_limiting_error_message( $decoded_body )
);
}
Expand Down

0 comments on commit fc16a6a

Please # to comment.