Skip to content

Commit fc16a6a

Browse files
Use static number instead of class constant
1 parent 4907e58 commit fc16a6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,10 @@ public function get_the_latest_github_version( $repo_slug ) {
826826
$body = \wp_remote_retrieve_body( $response );
827827
$decoded_body = json_decode( $body );
828828

829-
if ( wp_remote_retrieve_response_code( $response ) === \WP_Http::FORBIDDEN ) {
829+
// WP_Http::FORBIDDEN doesn't exist in WordPress 3.7
830+
if ( 403 === wp_remote_retrieve_response_code( $response ) ) {
830831
return new \WP_Error(
831-
\WP_Http::FORBIDDEN,
832+
403,
832833
$this->build_rate_limiting_error_message( $decoded_body )
833834
);
834835
}

0 commit comments

Comments
 (0)