Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when content of section body has URL in package-readme command #233

Closed
2 tasks done
ernilambar opened this issue Mar 12, 2024 · 1 comment · Fixed by #234
Closed
2 tasks done

Error when content of section body has URL in package-readme command #233

ernilambar opened this issue Mar 12, 2024 · 1 comment · Fixed by #234

Comments

@ernilambar
Copy link
Contributor

Bug Report

Describe the current, buggy behavior

Regarding wp scaffold package-readme command.

"support": {
  "body": "[Visit Support](https://asdf.com)"
}

When I run wp scaffold package-readme . command, following error appears.

Error: Failed to get url '[Visit Support](https://asdf.com)': Only HTTP(S) requests are handled..

Describe what you would expect as the correct outcome

Accurate readme file should be generated.

Let us know what environment you are running this on

OS:	Darwin 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov  7 21:48:06 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_X86_64 x86_64
Shell:	/bin/zsh
PHP binary:	/usr/local/Cellar/php@8.2/8.2.16_1/bin/php
PHP version:	8.2.16
php.ini used:	/usr/local/etc/php/8.2/php.ini
MySQL binary:	/usr/local/bin/mysql
MySQL version:	mysql  Ver 8.3.0 for macos13.6 on x86_64 (Homebrew)
SQL modes:	
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/nilambarsharma/Work/wpcmd/database-command
WP-CLI packages dir:	/Users/nilambarsharma/.wp-cli/packages/
WP-CLI cache dir:	/Users/nilambarsharma/.wp-cli/cache
WP-CLI global config:	
WP-CLI project config:	/Users/nilambarsharma/Work/wpcmd/database-command/wp-cli.yml
WP-CLI version:	2.10.0

Provide a possible solution

if ( false !== strpos( $v, '://' ) ) {

Whenever :// is there in the value, package tries for GET request. We should improve this condition.

@danielbachhuber
Copy link
Member

Makes sense, thanks for flagging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants