Skip to content

Commit c6b8fc8

Browse files
Merge pull request #1156 from Codeinwp/bugfix/pro/939
Fixed SSRF vulanaribility
2 parents 58e7419 + 1601157 commit c6b8fc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

includes/abstract/feedzy-rss-feeds-admin-abstract.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,14 @@ public function normalize_urls( $raw ) {
697697
$feed_url = apply_filters( 'feedzy_get_feed_url', $feeds );
698698
if ( is_array( $feed_url ) ) {
699699
foreach ( $feed_url as $index => $url ) {
700-
$feed_url[ $index ] = trim( $this->smart_convert( $url ) );
700+
if ( wp_http_validate_url( $url ) ) {
701+
$feed_url[ $index ] = trim( $this->smart_convert( esc_url_raw( $url ) ) );
702+
}
701703
}
704+
} elseif ( wp_http_validate_url( $feed_url ) ) {
705+
$feed_url = trim( $this->smart_convert( esc_url_raw( $feed_url ) ) );
702706
} else {
703-
$feed_url = trim( $this->smart_convert( $feed_url ) );
707+
$feed_url = '';
704708
}
705709

706710
return $feed_url;

0 commit comments

Comments
 (0)