Skip to content

Commit

Permalink
Improve URL validation for scaffold package readme section
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Mar 13, 2024
1 parent 5655856 commit 1778818
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ScaffoldPackageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public function package_readme( $args, $assoc_args ) {
$v = '';
if ( isset( $composer_obj['extra']['readme'][ $section ][ $k ] ) ) {
$v = $composer_obj['extra']['readme'][ $section ][ $k ];
if ( false !== strpos( $v, '://' ) ) {
if ( filter_var( $v, FILTER_VALIDATE_URL ) === $v ) {
$response = Utils\http_request( 'GET', $v );
$v = $response->body;
} elseif ( preg_match( $ext_regex, $v ) ) {
Expand Down

0 comments on commit 1778818

Please sign in to comment.