Skip to content

Commit 26beaed

Browse files
fix: retrive image URL from query params
1 parent 2b8fe4f commit 26beaed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,10 +1925,10 @@ public function feedzy_blacklist_images() {
19251925
*/
19261926
public function feedzy_image_encode( $img_url ) {
19271927
// Check if img url is set as an URL parameter.
1928-
$parsed_url = wp_parse_url( $img_url );
1929-
if ( isset( $parsed_url['query'] ) ) {
1930-
preg_match_all( '/(http|https):\/\/[^ ]+(\.(gif|jpg|jpeg|png|webp|avif))/i', $parsed_url['query'], $matches );
1931-
if ( isset( $matches[0][0] ) && $this->is_image_url( $matches[0][0] ) ) {
1928+
$url_tab = wp_parse_url( $img_url );
1929+
if ( isset( $url_tab['query'] ) ) {
1930+
preg_match_all( '/(http|https):\/\/[^ ]+(\.gif|\.GIF|\.jpg|\.JPG|\.jpeg|\.JPEG|\.png|\.PNG)/', $url_tab['query'], $matches );
1931+
if ( isset( $matches[0][0] ) ) {
19321932
$img_url = $matches[0][0];
19331933
}
19341934
}

0 commit comments

Comments
 (0)