Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use static number instead of class constant
  • Loading branch information
danielbachhuber committed Apr 27, 2024
commit fc16a6a5c7cbd552382bce042440468f21f23d3e
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