Skip to content

Commit 2800038

Browse files
committed
Filter empty urls on getImagesUrls
1 parent a06a333 commit 2800038

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Adapters/Adapter.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,15 @@ public function getProviderUrl()
302302
*/
303303
public function getImagesUrls()
304304
{
305-
return Utils::getData($this->providers, 'imagesUrls', $this->request->url);
305+
$imagesUrls = Utils::getData($this->providers, 'imagesUrls', $this->request->url);
306+
307+
$imagesUrls = array_filter($imagesUrls, function($imageUrl) {
308+
// Clean empty urls
309+
return !empty($imageUrl['value']);
310+
});
311+
312+
// Use array_values to reset keys after filter
313+
return array_values($imagesUrls);
306314
}
307315

308316
/**

0 commit comments

Comments
 (0)