aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-08-15 13:19:34 -0700
committerredmatrix <git@macgirvin.com>2016-08-15 13:19:34 -0700
commit055ee753021c7977401f6e9c847991515c9c4e3a (patch)
tree179b3d7b83a20c7689b61c67a54ce7e6ccf54bfc /Zotlabs
parentf95011a565e3ec5525ba44fe50a4dfcdb4556107 (diff)
parent6bb5ea7a818c1f43ab62e0e047571a83a2457ceb (diff)
downloadvolse-hubzilla-055ee753021c7977401f6e9c847991515c9c4e3a.tar.gz
volse-hubzilla-055ee753021c7977401f6e9c847991515c9c4e3a.tar.bz2
volse-hubzilla-055ee753021c7977401f6e9c847991515c9c4e3a.zip
Merge branch '1.12RC' of https://github.com/redmatrix/hubzilla into 1.12RC_merge
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Embedphotos.php12
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'];