1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00

get rid of warning about foreach due to non-existing author field

This commit is contained in:
frankdelange 2015-02-12 23:50:06 +01:00
parent 113aff42e6
commit 0f7a2b145a

View file

@ -3,11 +3,11 @@
<updated><?php p(date("Y-m-d\TH:i:sP",strtotime($_['file']['meta']['updated']))); ?></updated> <updated><?php p(date("Y-m-d\TH:i:sP",strtotime($_['file']['meta']['updated']))); ?></updated>
<id>id:<?php p($_['file']['id']); ?></id> <id>id:<?php p($_['file']['id']); ?></id>
<dcterms:extent><?php p($_['file']['humansize']); ?></dcterms:extent> <dcterms:extent><?php p($_['file']['humansize']); ?></dcterms:extent>
<?php foreach (json_decode($_['file']['meta']['author'],true) as $author): ?> <?php $authors = json_decode($_['file']['meta']['author'],true); if(is_array($authors)): foreach ($authors as $author): ?>
<author> <author>
<name><?php p($author); ?></name> <name><?php p($author); ?></name>
</author> </author>
<?php endforeach; ?> <?php endforeach; endif; ?>
<?php if($_['file']['meta']['isbn']): ?> <?php if($_['file']['meta']['isbn']): ?>
<dc:identifier>urn:isbn:<?php p($_['file']['meta']['isbn']); ?></dc:identifier> <dc:identifier>urn:isbn:<?php p($_['file']['meta']['isbn']); ?></dc:identifier>
<?php endif; ?> <?php endif; ?>