aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-09-20 00:00:26 -0700
committerzotlabs <mike@macgirvin.com>2017-09-20 00:00:26 -0700
commit9e46472ca26f2bd38d2e71c221a9fbf5618b5822 (patch)
tree9598b8d5bb0c33299494876c7f9f9927d393494a
parent61d9b34929adc831eb780fd3410660eb98c114a9 (diff)
downloadvolse-hubzilla-9e46472ca26f2bd38d2e71c221a9fbf5618b5822.tar.gz
volse-hubzilla-9e46472ca26f2bd38d2e71c221a9fbf5618b5822.tar.bz2
volse-hubzilla-9e46472ca26f2bd38d2e71c221a9fbf5618b5822.zip
provide default photo mimetype
-rw-r--r--include/channel.php5
-rw-r--r--include/perm_upgrade.php3
-rw-r--r--include/photo/photo_driver.php1
3 files changed, 8 insertions, 1 deletions
diff --git a/include/channel.php b/include/channel.php
index 7072bb4ce..fef933ba7 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -278,11 +278,13 @@ function create_identity($arr) {
intval($arr['account_id'])
);
+ $photo_type = null;
+
$z = [ 'account' => $a[0], 'channel' => $r[0], 'photo_url' => '' ];
call_hooks('create_channel_photo',$z);
if($z['photo_url']) {
- import_channel_photo_from_url($z['photo_url'],$arr['account_id'],$r[0]['channel_id']);
+ $photo_type = import_channel_photo_from_url($z['photo_url'],$arr['account_id'],$r[0]['channel_id']);
}
if($role_permissions && array_key_exists('limits',$role_permissions))
@@ -330,6 +332,7 @@ function create_identity($arr) {
'xchan_guid' => $guid,
'xchan_guid_sig' => $sig,
'xchan_pubkey' => $key['pubkey'],
+ 'xchan_photo_mimetype' => (($photo_type) ? $photo_type : 'image/png'),
'xchan_photo_l' => z_root() . "/photo/profile/l/{$newuid}",
'xchan_photo_m' => z_root() . "/photo/profile/m/{$newuid}",
'xchan_photo_s' => z_root() . "/photo/profile/s/{$newuid}",
diff --git a/include/perm_upgrade.php b/include/perm_upgrade.php
index 5be1ffbb2..9eb1efba2 100644
--- a/include/perm_upgrade.php
+++ b/include/perm_upgrade.php
@@ -135,6 +135,9 @@ function translate_abook_perms_outbound(&$abook) {
$my_perms = 0;
$their_perms = 0;
+ if(! $abook)
+ return;
+
if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && $abook['abconfig']) {
foreach($abook['abconfig'] as $p) {
if($p['cat'] === 'their_perms') {
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index c6c023147..17ca81419 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -666,6 +666,7 @@ function import_channel_photo_from_url($photo,$aid,$uid) {
import_channel_photo($img_str,$type,$aid,$uid);
+ return $type;
}