Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions features/package-install.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,9 @@ Feature: Install WP-CLI packages

When I try `wp package install https://example.com/non-existent-zip-asdfasdf.zip`
Then the return code should be 1
And STDERR should be:
And STDERR should contain:
"""
Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip' (HTTP code 404).
Error: Couldn't download package from 'https://example.com/non-existent-zip-asdfasdf.zip'
"""
And STDOUT should be empty

Expand Down
4 changes: 2 additions & 2 deletions src/Package_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ private function check_github_package_name( $package_name, $version = '', $insec
* to false.
*/
private function check_git_package_name( $package_name, $url = '', $version = '', $insecure = false ) {
if ( $url && ( strpos( $url, '://gitlab.com/' ) !== false ) || ( strpos( $url, 'git@gitlab.com:' ) !== false ) ) {
if ( $url && ( ( strpos( $url, '://gitlab.com/' ) !== false ) || ( strpos( $url, 'git@gitlab.com:' ) !== false ) ) ) {
$matches = [];
preg_match( '#gitlab.com[:/](.*?)\.git#', $url, $matches );
return $this->check_gitlab_package_name( $matches[1], $version, $insecure );
Expand All @@ -1178,7 +1178,7 @@ private function check_git_package_name( $package_name, $url = '', $version = ''
/**
* Checks that `$package_name` matches the name in composer.json at GitLab.com, and return corrected value if not.
*
* @param string $package_name Package name to check.
* @param string $project_name Package name to check.
* @param string $version Optional. Package version. Defaults to empty string.
* @param bool $insecure Optional. Whether to insecurely retry downloads that failed TLS handshake. Defaults
* to false.
Expand Down