aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-08-05 22:07:51 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-08-05 22:07:51 -0700
commit880dec5a4e6d0acbc3bcab7399c3490f71820c01 (patch)
tree5a7f37de49e6f5d5ddb87c3d7387fb8d109876e1 /mod
parentdfb8a1b2d410eb27a647b967d857207162fa6540 (diff)
downloadvolse-hubzilla-880dec5a4e6d0acbc3bcab7399c3490f71820c01.tar.gz
volse-hubzilla-880dec5a4e6d0acbc3bcab7399c3490f71820c01.tar.bz2
volse-hubzilla-880dec5a4e6d0acbc3bcab7399c3490f71820c01.zip
don't throw errors or do the wrong thing if photos have no album (placed on your dav rootdir)
Diffstat (limited to 'mod')
-rw-r--r--mod/photos.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/mod/photos.php b/mod/photos.php
index b65218e94..55a1aea90 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -474,7 +474,12 @@ function photos_content(&$a) {
$datatype = argv(2);
$datum = argv(3);
} else {
- $datatype = 'summary';
+ if(argc() > 2) {
+ $datatype = argv(2);
+ $datum = '';
+ }
+ else
+ $datatype = 'summary';
}
if(argc() > 4)
@@ -602,15 +607,15 @@ function photos_content(&$a) {
if($datatype === 'album') {
-
-
- if((strlen($datum) & 1) || (! ctype_xdigit($datum))) {
- notice( t('Album name could not be decoded') . EOL);
- logger('mod_photos: illegal album encoding: ' . $datum);
- $datum = '';
+ if(strlen($datum)) {
+ if((strlen($datum) & 1) || (! ctype_xdigit($datum))) {
+ notice( t('Album name could not be decoded') . EOL);
+ logger('mod_photos: illegal album encoding: ' . $datum);
+ $datum = '';
+ }
}
- $album = hex2bin($datum);
+ $album = (($datum) ? hex2bin($datum) : '');
$r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
AND `scale` <= 4 and photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY `resource_id`",