Skip to content

Commit 8309a58

Browse files
committed
🐛 will not crash on missing images or videos
1 parent 9597587 commit 8309a58

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bnomei/kirby3-feed",
33
"type": "kirby-plugin",
4-
"version": "1.4.2",
4+
"version": "1.4.4",
55
"description": "Generate a RSS/JSON/Sitemap-Feed from a Pages-Collection",
66
"license": "MIT",
77
"authors": [

snippets/feed/sitemap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@
1616
<?php endforeach; ?>
1717
<lastmod><?= $modified ?></lastmod>
1818
<?php if($images): ?>
19-
<?php foreach($item->{$imagesfield}() as $image): ?>
19+
<?php foreach($item->{$imagesfield}() as $image): if($image): ?>
2020
<image:image>
2121
<image:loc><?= $image->url() ?></image:loc>
2222
<?php if($image->{$imagetitlefield}()->isNotEmpty()): ?><image:title><?= $image->{$imagetitlefield}() ?></image:title><?php endif; ?>
2323
<?php if($image->{$imagecaptionfield}()->isNotEmpty()): ?><image:caption><?= $image->{$imagecaptionfield}() ?></image:caption><?php endif; ?>
2424
<?php if($image->{$imagelicensefield}()->isNotEmpty()): ?><image:license><?= $image->{$imagelicensefield}() ?></image:license><?php endif; ?>
2525
</image:image>
26-
<?php endforeach; ?>
26+
<?php endif; endforeach; ?>
2727
<?php endif; ?>
2828
<?php if($videos): ?>
29-
<?php foreach($item->{$videosfield}() as $video): ?>
29+
<?php foreach($item->{$videosfield}() as $video): if($video): ?>
3030
<video:video>
3131
<?php if($image->{$videothumbnailfield}()->isNotEmpty()): ?><video:thumbnail><?= $video->{$videothumbnailfield}() ?></video:thumbnail><?php endif; ?>
3232
<?php if($image->{$videotitlefield}()->isNotEmpty()): ?><video:title><?= \Kirby\Toolkit\Xml::encode($item->{$videotitlefield}()) ?></video:title><?php endif; ?>
3333
<?php if($image->{$videodescriptionfield}()->isNotEmpty()): ?><video:description><?= \Kirby\Toolkit\Xml::encode($item->{$videodescriptionfield}()) ?></video:description><?php endif; ?>
3434
<?php if(Str::contains($video->{$videourlfield}(), site()->url())): ?><video:content_loc><?= $video->{$videourlfield}() ?></video:content_loc>
3535
<?php else: ?><video:player_loc><?= $video->{$videourlfield}() ?></video:player_loc><?php endif; ?>
3636
</video:video>
37-
<?php endforeach; ?>
37+
<?php endif; endforeach; ?>
3838
<?php endif; ?>
3939
</url>
4040
<?php endforeach; ?>

vendor/composer/installed.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php return array(
22
'root' => array(
3-
'pretty_version' => '1.4.2',
4-
'version' => '1.4.2.0',
3+
'pretty_version' => '1.4.4',
4+
'version' => '1.4.4.0',
55
'type' => 'kirby-plugin',
66
'install_path' => __DIR__ . '/../../',
77
'aliases' => array(),
@@ -11,8 +11,8 @@
1111
),
1212
'versions' => array(
1313
'bnomei/kirby3-feed' => array(
14-
'pretty_version' => '1.4.2',
15-
'version' => '1.4.2.0',
14+
'pretty_version' => '1.4.4',
15+
'version' => '1.4.4.0',
1616
'type' => 'kirby-plugin',
1717
'install_path' => __DIR__ . '/../../',
1818
'aliases' => array(),

0 commit comments

Comments
 (0)