Improve URL validation for scaffold package readme section

This commit is contained in:
Nilambar Sharma 2024-03-13 10:50:52 +05:45
parent 5655856595
commit 1778818a61

View file

@ -399,7 +399,7 @@ EOT;
$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 ) ) {