Skip to content

Commit c0445e4

Browse files
Copilotswissspidy
andcommitted
Add context check to capture_version_check_error method
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent d683f7c commit c0445e4

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎composer.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,11 @@
7979
},
8080
"support": {
8181
"issues": "https://github.com/wp-cli/core-command/issues"
82+
},
83+
"repositories": {
84+
"self": {
85+
"type": "path",
86+
"url": "."
87+
}
8288
}
8389
}

‎src/Core_Command.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,11 @@ private function capture_version_check_error( $response, $context, $class, $args
15381538
return;
15391539
}
15401540

1541+
// Only capture on response, not pre_response
1542+
if ( 'response' !== $context ) {
1543+
return;
1544+
}
1545+
15411546
// Store the error if the response is a WP_Error
15421547
if ( is_wp_error( $response ) ) {
15431548
$this->version_check_error = $response;

0 commit comments

Comments
 (0)