From 1778818a61b7240b0f31856035e5be51da17fdb4 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Wed, 13 Mar 2024 10:50:52 +0545 Subject: [PATCH] Improve URL validation for scaffold package readme section --- src/ScaffoldPackageCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScaffoldPackageCommand.php b/src/ScaffoldPackageCommand.php index 551251b..0ab3be4 100644 --- a/src/ScaffoldPackageCommand.php +++ b/src/ScaffoldPackageCommand.php @@ -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 ) ) {