diff options
author | hubzilla <git@macgirvin.com> | 2016-08-14 09:54:12 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-14 09:54:12 +1000 |
commit | 5ad5afe63b420416a9d31cadf6127f5f5644d068 (patch) | |
tree | 8c7cea57c90f3fa5e8480080b2c0ea237f071438 | |
parent | 2c3843ee4cd1721a6089549547768f4ee00aee6a (diff) | |
parent | 125713e9385a485b9b9615c0f016e99954c9cfcf (diff) | |
download | volse-hubzilla-5ad5afe63b420416a9d31cadf6127f5f5644d068.tar.gz volse-hubzilla-5ad5afe63b420416a9d31cadf6127f5f5644d068.tar.bz2 volse-hubzilla-5ad5afe63b420416a9d31cadf6127f5f5644d068.zip |
Merge pull request #481 from anaqreon/issue-475
Fixed bug preventing images in root photo album from loading in embed…
-rw-r--r-- | Zotlabs/Module/Embedphotos.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Zotlabs/Module/Embedphotos.php b/Zotlabs/Module/Embedphotos.php index 0dac873c5..0dc745b0a 100644 --- a/Zotlabs/Module/Embedphotos.php +++ b/Zotlabs/Module/Embedphotos.php @@ -39,9 +39,9 @@ class Embedphotos extends \Zotlabs\Web\Controller { json_return_and_die(array('errormsg' => 'Error retrieving link ' . $href, 'status' => false)); } $resource_id = array_pop(explode("/", $href)); - $r = q("SELECT obj from item where resource_type = 'photo' and resource_id = '%s' limit 1", - dbesc($resource_id) - ); + $r = q("SELECT obj,body from item where resource_type = 'photo' and resource_id = '%s' limit 1", + dbesc($resource_id) + ); if(!$r) { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); } @@ -50,7 +50,9 @@ class Embedphotos extends \Zotlabs\Web\Controller { $photolink = $obj['body']; } elseif (x($obj,'bbcode')) { $photolink = $obj['bbcode']; - } else { + } elseif ($r[0]['body'] !== '') { + $photolink = $r[0]['body']; + } else { json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false)); } json_return_and_die(array('status' => true, 'photolink' => $photolink)); @@ -83,7 +85,7 @@ function embedphotos_widget_album($args) { return ''; if($args['album']) - $album = $args['album']; + $album = (($args['album'] === '/') ? '' : $args['album'] ); if($args['title']) $title = $args['title']; |