Merge pull request #5941 from MrPetovan/bug/5932-fix-notices

Fix PHP notices S02E02
This commit is contained in:
Tobias Diekershoff 2018-10-17 07:42:51 +02:00 committed by GitHub
commit ae85543aec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 15 deletions

View File

@ -73,6 +73,7 @@ function parse_url_content(App $a)
$hdrs[$k] = $v;
}
}
$type = null;
if (array_key_exists('Content-Type', $hdrs)) {
$type = $hdrs['Content-Type'];
}

View File

@ -380,7 +380,7 @@ class Item extends BaseObject
$usermode = true;
}
$fields = self::fieldlist($selected, $usermode);
$fields = self::fieldlist($usermode);
$select_fields = self::constructSelectFields($fields, $selected);
@ -487,7 +487,7 @@ class Item extends BaseObject
$usermode = true;
}
$fields = self::fieldlist($selected, $usermode);
$fields = self::fieldlist($usermode);
$fields['thread'] = ['mention', 'ignored', 'iid'];
@ -523,7 +523,7 @@ class Item extends BaseObject
*
* @return array field list
*/
private static function fieldlist($selected, $usermode)
private static function fieldlist($usermode)
{
$fields = [];

View File

@ -461,7 +461,7 @@ class Receiver
logger('Switch contact ' . $cid . ' (' . $profile['url'] . ') for user ' . $uid . ' to ActivityPub');
$photo = $profile['photo'];
$photo = defaults($profile, 'photo', null);
unset($profile['photo']);
unset($profile['baseurl']);

View File

@ -949,6 +949,7 @@ class Diaspora
$person = DBA::selectFirst('fcontact', [], ['network' => Protocol::DIASPORA, 'addr' => $handle]);
if (!DBA::isResult($person)) {
$person = $r;
$person['id'] = 0;
}
}
}
@ -3429,12 +3430,9 @@ class Diaspora
/// @todo - establish "all day" events in Friendica
$eventdata["all_day"] = "false";
if (!$event['adjust']) {
$eventdata['timezone'] = $user['timezone'];
if ($eventdata['timezone'] == "") {
$eventdata['timezone'] = 'UTC';
}
if (!$event['adjust'] && $user['timezone']) {
$eventdata['timezone'] = $user['timezone'];
}
if ($event['start']) {

View File

@ -141,7 +141,7 @@ class ParseUrl
}
// If the file is too large then exit
if ($curlResult->getInfo()['download_content_length'] > 1000000) {
if (defaults($curlResult->getInfo(), 'download_content_length', 0) > 1000000) {
return $siteinfo;
}

View File

@ -39,13 +39,13 @@ class Delivery extends BaseObject
$followup = false;
$public_message = false;
$items = [];
if ($cmd == self::MAIL) {
$target_item = DBA::selectFirst('mail', [], ['id' => $item_id]);
if (!DBA::isResult($target_item)) {
return;
}
$uid = $target_item['uid'];
$items = [];
} elseif ($cmd == self::SUGGESTION) {
$target_item = DBA::selectFirst('fsuggest', [], ['id' => $item_id]);
if (!DBA::isResult($target_item)) {
@ -65,7 +65,6 @@ class Delivery extends BaseObject
$params = ['order' => ['id']];
$itemdata = Item::select([], $condition, $params);
$items = [];
while ($item = Item::fetch($itemdata)) {
if ($item['id'] == $parent_id) {
$parent = $item;