From 4812c5486db3f49cd1df34f8678c51369ac76d7a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 16 Nov 2018 21:14:11 +0000 Subject: strlen($this->imageString()) does not return the correct size when dealing with os_storage images. use filesize() instead. (cherry picked from commit afc75af62f759181bbe6a806b523c6ca52126f5f) --- include/photo/photo_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 4173d727e..b70a13622 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -413,7 +413,7 @@ abstract class photo_driver { intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), - intval(strlen($this->imageString())), + (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), @@ -445,7 +445,7 @@ abstract class photo_driver { intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), - intval(strlen($this->imageString())), + (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), -- cgit v1.2.3 From 3787c490d4fe9c6beda393580e4ee8ad8f7cd6dc Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 18 Nov 2018 07:00:06 -0500 Subject: Fix: delayed items propagate before publication on cloned channels --- include/items.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index 2baad3d04..8268d3fe7 100755 --- a/include/items.php +++ b/include/items.php @@ -618,8 +618,6 @@ function get_item_elements($x,$allow_code = false) { $arr['created'] = datetime_convert('UTC','UTC',$x['created']); $arr['edited'] = datetime_convert('UTC','UTC',$x['edited']); - if($arr['created'] > datetime_convert()) - $arr['created'] = datetime_convert(); if($arr['edited'] > datetime_convert()) $arr['edited'] = datetime_convert(); -- cgit v1.2.3 From 48cd5855fe0bb530d3a26ea3a095bd3ab9c2493e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 11:06:14 +0100 Subject: Add photo cache support using sslify() --- include/text.php | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 646bfe749..113448a92 100644 --- a/include/text.php +++ b/include/text.php @@ -1105,12 +1105,33 @@ function linkify($s, $me = false) { * to a local redirector which uses https and which redirects to the selected content * * @param string $s + * @param int $uid * @returns string */ -function sslify($s) { +function sslify($s, $uid) { + + // Local photo cache + if(get_config('system','photo_cache_enable', 0)) { + $matches = null; + $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); + if ($cnt) { + foreach ($matches as $match) { + logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); + $cache = array( + 'url' => $match[2], + 'uid' => $uid + ); + call_hooks('cache_url_hook', $cache); + logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); + if($cache['cached']) + $s = str_replace($match[2], z_root() . '/photo/' . $cache['hash'] . '-' . $cache['res'], $s); + } + } + } + if (strpos(z_root(),'https:') === false) return $s; - + // By default we'll only sslify img tags because media files will probably choke. // You can set sslify_everything if you want - but it will likely white-screen if it hits your php memory limit. // The downside is that http: media files will likely be blocked by your browser @@ -1118,7 +1139,7 @@ function sslify($s) { $allow = get_config('system','sslify_everything'); - $pattern = (($allow) ? "/\<(.*?)src=\"(http\:.*?)\"(.*?)\>/" : "/\/" ); + $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); $matches = null; $cnt = preg_match_all($pattern,$s,$matches,PREG_SET_ORDER); @@ -1681,7 +1702,7 @@ function prepare_body(&$item,$attach = false,$opts = false) { if(local_channel() == $item['uid']) $filer = format_filer($item); - $s = sslify($s); + $s = sslify($s, $item['uid']); $prep_arr = array( 'item' => $item, @@ -3259,7 +3280,7 @@ function share_unshield($m) { } -function cleanup_bbcode($body) { +function cleanup_bbcode($body, $uid = 0) { /** * fix naked links by passing through a callback to see if this is a hubzilla site @@ -3295,7 +3316,7 @@ function cleanup_bbcode($body) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); - $body = scale_external_images($body,false); + $body = scale_external_images($body, false, false, $uid); return $body; } -- cgit v1.2.3 From d9faf6c4bb5d26d6eff5e3176b46761ea26dcf63 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 11:48:12 +0100 Subject: Update text.php --- include/text.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 113448a92..5574b9054 100644 --- a/include/text.php +++ b/include/text.php @@ -3280,7 +3280,7 @@ function share_unshield($m) { } -function cleanup_bbcode($body, $uid = 0) { +function cleanup_bbcode($body) { /** * fix naked links by passing through a callback to see if this is a hubzilla site @@ -3316,7 +3316,7 @@ function cleanup_bbcode($body, $uid = 0) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); - $body = scale_external_images($body, false, false, $uid); + $body = scale_external_images($body, false); return $body; } -- cgit v1.2.3 From d8b5f383f52274e30e02a8cf8ce77aac0a6bd910 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 16:21:50 +0100 Subject: Disable links to cached photos for non logged viewers --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 5574b9054..00e12dc06 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,7 +1111,7 @@ function linkify($s, $me = false) { function sslify($s, $uid) { // Local photo cache - if(get_config('system','photo_cache_enable', 0)) { + if(get_config('system','photo_cache_enable', 0) && local_channel()) { $matches = null; $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); if ($cnt) { -- cgit v1.2.3 From 9de650e17521542d84d9d07e2c3fabfbf1519acc Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 19:13:43 +0100 Subject: Cache for viewer channel --- include/text.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 00e12dc06..a20d9564b 100644 --- a/include/text.php +++ b/include/text.php @@ -1108,18 +1108,17 @@ function linkify($s, $me = false) { * @param int $uid * @returns string */ -function sslify($s, $uid) { +function sslify($s) { // Local photo cache if(get_config('system','photo_cache_enable', 0) && local_channel()) { $matches = null; - $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); if ($cnt) { foreach ($matches as $match) { logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); $cache = array( - 'url' => $match[2], - 'uid' => $uid + 'url' => $match[2] ); call_hooks('cache_url_hook', $cache); logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); @@ -1702,7 +1701,7 @@ function prepare_body(&$item,$attach = false,$opts = false) { if(local_channel() == $item['uid']) $filer = format_filer($item); - $s = sslify($s, $item['uid']); + $s = sslify($s); $prep_arr = array( 'item' => $item, -- cgit v1.2.3 From 1a9ea6452305c44df285e16f17475a5b16b54a37 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 19:28:54 +0100 Subject: Update text.php --- include/text.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index a20d9564b..bb9c6075b 100644 --- a/include/text.php +++ b/include/text.php @@ -1118,7 +1118,8 @@ function sslify($s) { foreach ($matches as $match) { logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); $cache = array( - 'url' => $match[2] + 'url' => $match[2], + 'uid' => local_channel() ); call_hooks('cache_url_hook', $cache); logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); -- cgit v1.2.3 From 3265c2e54305fd46fdb237d716d34b4e77e98e08 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 20:36:21 +0100 Subject: Skip sslify for images if it already were cached with https enabled --- include/text.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index bb9c6075b..426229d36 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,7 +1111,8 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - if(get_config('system','photo_cache_enable', 0) && local_channel()) { + $cacheon = get_config('system','photo_cache_enable', 0); + if($cache && local_channel()) { $matches = null; $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); if ($cnt) { @@ -1138,6 +1139,10 @@ function sslify($s) { // Complain to your browser maker $allow = get_config('system','sslify_everything'); + + //We can skip next part if this only images and cache is on + if((! $allow) && $cacheon) + return $s; $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); -- cgit v1.2.3 From d6442ec99160c1f556d9e5b7bc3b2fec76200aa1 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 23:07:39 +0100 Subject: Update text.php --- include/text.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 426229d36..234747342 100644 --- a/include/text.php +++ b/include/text.php @@ -1139,11 +1139,6 @@ function sslify($s) { // Complain to your browser maker $allow = get_config('system','sslify_everything'); - - //We can skip next part if this only images and cache is on - if((! $allow) && $cacheon) - return $s; - $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); $matches = null; -- cgit v1.2.3 From 6f2d09eb205f09cdc83225b6fadff316b934e1eb Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 23:28:45 +0100 Subject: Fix wrong parameter --- include/text.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 234747342..7c0610ed9 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,10 +1111,9 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - $cacheon = get_config('system','photo_cache_enable', 0); - if($cache && local_channel()) { + if(get_config('system','photo_cache_enable', 0) && local_channel()) { $matches = null; - $cnt = preg_match_all("/\/",$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all("/\/", $s, $matches, PREG_SET_ORDER); if ($cnt) { foreach ($matches as $match) { logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); @@ -1142,7 +1141,7 @@ function sslify($s) { $pattern = (($allow) ? "/\<(.*?)src=[\"|'](http\:.*?)[\"|'](.*?)\>/" : "/\/" ); $matches = null; - $cnt = preg_match_all($pattern,$s,$matches,PREG_SET_ORDER); + $cnt = preg_match_all($pattern, $s, $matches, PREG_SET_ORDER); if ($cnt) { foreach ($matches as $match) { $filename = basename( parse_url($match[2], PHP_URL_PATH) ); -- cgit v1.2.3 From 0ee403eab3a29a98f85dc9fe304c25c6f037b24a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 30 Nov 2018 10:50:00 +0100 Subject: Move cache code to addon --- include/text.php | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 7c0610ed9..866b3fa2c 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,23 +1111,13 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - if(get_config('system','photo_cache_enable', 0) && local_channel()) { - $matches = null; - $cnt = preg_match_all("/\/", $s, $matches, PREG_SET_ORDER); - if ($cnt) { - foreach ($matches as $match) { - logger('uid: ' . $uid . '; url: ' . $match[2], LOGGER_DEBUG); - $cache = array( - 'url' => $match[2], - 'uid' => local_channel() - ); - call_hooks('cache_url_hook', $cache); - logger('cache status: ' . intval($cache['status']) .'; cached as: ' . ($cache['cached'] ? $cache['hash'] : '-'), LOGGER_DEBUG); - if($cache['cached']) - $s = str_replace($match[2], z_root() . '/photo/' . $cache['hash'] . '-' . $cache['res'], $s); - } - } - } + $str = array( + 'body' => $s, + 'uid' => local_channel() + ); + call_hooks('cache_body_hook', $str); + + $s = $str['body']; if (strpos(z_root(),'https:') === false) return $s; -- cgit v1.2.3 From 53d9cbc69cecc0825c1e8fdc670cfe8ea09b03bf Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 30 Nov 2018 11:38:47 +0100 Subject: Check local_channel() before cache call --- include/text.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 866b3fa2c..6e4402a9f 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,13 +1111,15 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - $str = array( - 'body' => $s, - 'uid' => local_channel() - ); - call_hooks('cache_body_hook', $str); + if(local_channel()) { + $str = array( + 'body' => $s, + 'uid' => local_channel() + ); + call_hooks('cache_body_hook', $str); - $s = $str['body']; + $s = $str['body']; + } if (strpos(z_root(),'https:') === false) return $s; -- cgit v1.2.3 From df843523850237b0be1eadee99b01b20685917f4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 1 Dec 2018 21:37:33 +0100 Subject: make pdf preview 100% width and 300px height to match it openstreetmaps preview --- include/oembed.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/oembed.php b/include/oembed.php index e5557dc11..426197c5f 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -221,7 +221,11 @@ function oembed_fetch_url($embedurl){ if(strpos(strtolower($embedurl),'.pdf') !== false) { $action = 'allow'; - $j = [ 'html' => '' . '' . t('View PDF') . '', 'width' => 500, 'height' => 720, 'type' => 'pdf' ]; + $j = [ + 'html' => '', + 'title' => t('View PDF'), + 'type' => 'pdf' + ]; } -- cgit v1.2.3 From 2a57e00cb4a7dada0993e91e0e2176ad335cf12f Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sun, 2 Dec 2018 10:07:12 +0100 Subject: Remove local_channel() check on cache_body_hook call --- include/text.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 6e4402a9f..7f6e87d3b 100644 --- a/include/text.php +++ b/include/text.php @@ -1111,16 +1111,14 @@ function linkify($s, $me = false) { function sslify($s) { // Local photo cache - if(local_channel()) { - $str = array( - 'body' => $s, - 'uid' => local_channel() - ); - call_hooks('cache_body_hook', $str); - - $s = $str['body']; - } + $str = array( + 'body' => $s, + 'uid' => local_channel() + ); + call_hooks('cache_body_hook', $str); + $s = $str['body']; + if (strpos(z_root(),'https:') === false) return $s; -- cgit v1.2.3 From 19903ea3c1eecf24d72c76970c6027362c9df89e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sun, 2 Dec 2018 21:59:08 +0100 Subject: Add flag to allow to save image without validation --- include/photo/photo_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index b70a13622..6ec5602f4 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -330,9 +330,9 @@ abstract class photo_driver { } - public function save($arr) { + public function save($arr, $skipcheck = false) { - if(! $this->is_valid()) { + if(! ($skipcheck || $this->is_valid())) { logger('attempt to store invalid photo.'); return false; } -- cgit v1.2.3 From c165894ce97b353f5fe81a59708e0ea62268f773 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 3 Dec 2018 00:51:09 +0100 Subject: Add Expires field support --- include/photo/photo_driver.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 6ec5602f4..9aeb2ef17 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -112,7 +112,7 @@ abstract class photo_driver { public function saveImage($path) { if(!$this->is_valid()) return FALSE; - file_put_contents($path, $this->imageString()); + return (file_put_contents($path, $this->imageString()) ? true : false); } @@ -344,6 +344,7 @@ abstract class photo_driver { $p['xchan'] = (($arr['xchan']) ? $arr['xchan'] : ''); $p['resource_id'] = (($arr['resource_id']) ? $arr['resource_id'] : ''); $p['filename'] = (($arr['filename']) ? $arr['filename'] : ''); + $p['mimetype'] = (($arr['mimetype']) ? $arr['mimetype'] : $this->getType()); $p['album'] = (($arr['album']) ? $arr['album'] : ''); $p['imgscale'] = ((intval($arr['imgscale'])) ? intval($arr['imgscale']) : 0); $p['allow_cid'] = (($arr['allow_cid']) ? $arr['allow_cid'] : ''); @@ -360,6 +361,7 @@ abstract class photo_driver { $p['display_path'] = (($arr['display_path']) ? $arr['display_path'] : ''); $p['width'] = (($arr['width']) ? $arr['width'] : $this->getWidth()); $p['height'] = (($arr['height']) ? $arr['height'] : $this->getHeight()); + $p['expires'] = (($arr['expires']) ? $arr['expires'] : gmdate('Y-m-d H:i:s', time() + get_config('system','photo_cache_time', 86400))); if(! intval($p['imgscale'])) logger('save: ' . print_r($arr,true), LOGGER_DATA); @@ -397,17 +399,18 @@ abstract class photo_driver { allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', - deny_gid = '%s' + deny_gid = '%s', + expires = '%s' where id = %d", intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), dbesc($p['resource_id']), - dbesc($p['created']), - dbesc($p['edited']), + dbescdate($p['created']), + dbescdate($p['edited']), dbesc(basename($p['filename'])), - dbesc($this->getType()), + dbesc($p['mimetype']), dbesc($p['album']), intval($p['height']), intval($p['width']), @@ -424,22 +427,23 @@ abstract class photo_driver { dbesc($p['allow_gid']), dbesc($p['deny_cid']), dbesc($p['deny_gid']), + dbescdate($p['expires']), intval($x[0]['id']) ); } else { $p['created'] = (($arr['created']) ? $arr['created'] : $p['edited']); $r = q("INSERT INTO photo - ( aid, uid, xchan, resource_id, created, edited, filename, mimetype, album, height, width, content, os_storage, filesize, imgscale, photo_usage, title, description, os_path, display_path, allow_cid, allow_gid, deny_cid, deny_gid ) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", + ( aid, uid, xchan, resource_id, created, edited, filename, mimetype, album, height, width, content, os_storage, filesize, imgscale, photo_usage, title, description, os_path, display_path, allow_cid, allow_gid, deny_cid, deny_gid, expires ) + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), dbesc($p['resource_id']), - dbesc($p['created']), - dbesc($p['edited']), + dbescdate($p['created']), + dbescdate($p['edited']), dbesc(basename($p['filename'])), - dbesc($this->getType()), + dbesc($p['mimetype']), dbesc($p['album']), intval($p['height']), intval($p['width']), @@ -455,7 +459,8 @@ abstract class photo_driver { dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), - dbesc($p['deny_gid']) + dbesc($p['deny_gid']), + dbescdate($p['expires']) ); } logger('photo save ' . $p['imgscale'] . ' returned ' . intval($r)); -- cgit v1.2.3 From 2173ef5fb6025543398d2ee7b4d11c5c0971e92b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 3 Dec 2018 09:45:43 +0000 Subject: catch exception if readImageBlob() receives bogus data (cherry picked from commit 443d7684dbe8c1c3540df5aeb719403d67789747) --- include/photo/photo_imagick.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/photo/photo_imagick.php b/include/photo/photo_imagick.php index 89577e71e..f04c00245 100644 --- a/include/photo/photo_imagick.php +++ b/include/photo/photo_imagick.php @@ -31,8 +31,12 @@ class photo_imagick extends photo_driver { if(! $data) return; - $this->image->readImageBlob($data); - + try { + $this->image->readImageBlob($data); + } + catch (Exception $e) { + logger('imagick readImageBlob() exception:' . print_r($e,true)); + } /** * Setup the image to the format it will be saved to @@ -205,4 +209,4 @@ class photo_imagick extends photo_driver { -} \ No newline at end of file +} -- cgit v1.2.3 From c50e3a702aa93cc9fde1380e8addaeb62e4139b2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 3 Dec 2018 09:46:49 +0000 Subject: more notifications fixes (cherry picked from commit 9ef6c57ca59aa318a3564f6b48c6442870650d3e) --- include/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index cce8a6ed5..bd0d8048d 100644 --- a/include/text.php +++ b/include/text.php @@ -3421,7 +3421,7 @@ function get_forum_channels($uid) { $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 "); - $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra order by xchan_name", + $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra order by xchan_name", intval($uid) ); -- cgit v1.2.3