channel_type is not integer

(cherry picked from commit 26e7da0b96)
This commit is contained in:
zotlabs 2019-03-06 01:06:42 +00:00 committed by Mario
parent c4714e95b6
commit 571e9bf26a

View File

@ -685,14 +685,26 @@ class Libzot {
$adult_changed = 1; $adult_changed = 1;
if(intval($r[0]['xchan_deleted']) != intval($arr['deleted'])) if(intval($r[0]['xchan_deleted']) != intval($arr['deleted']))
$deleted_changed = 1; $deleted_changed = 1;
// new style 6-MAR-2019
if(array_key_exists('channel_type',$arr)) {
if($arr['channel_type'] === 'collection') {
// do nothing at this time.
}
elseif($arr['channel_type'] === 'group') {
$arr['public_forum'] = 1;
}
else {
$arr['public_forum'] = 0;
}
}
// old style // old style
if(intval($r[0]['xchan_pubforum']) != intval($arr['public_forum'])) if(intval($r[0]['xchan_pubforum']) != intval($arr['public_forum']))
$pubforum_changed = 1; $pubforum_changed = 1;
// new style 6-MAR-2019
if(array_key_exists('channel_type',$arr) && intval($arr['channel_type']) < 2 && intval($r[0]['xchan_pubforum']) !== intval($arr['channel_type'])) {
$pubforum_changed = 1;
$arr['public_forum'] = $arr['channel_type'];
}
if($arr['protocols']) { if($arr['protocols']) {
$protocols = implode(',',$arr['protocols']); $protocols = implode(',',$arr['protocols']);