mirror of
https://github.com/friendica/friendica
synced 2025-04-28 17:44:22 +02:00
Fix various notices
This commit is contained in:
parent
607f7daf51
commit
b6e1571b1e
7 changed files with 17 additions and 17 deletions
|
@ -117,7 +117,7 @@ class Email
|
|||
return $ret;
|
||||
}
|
||||
|
||||
if (!$struc->parts) {
|
||||
if (empty($struc->parts)) {
|
||||
$ret['body'] = self::messageGetPart($mbox, $uid, $struc, 0, 'html');
|
||||
$html = $ret['body'];
|
||||
|
||||
|
@ -482,13 +482,11 @@ class Email
|
|||
'[\r\n]\s*-----BEGIN PGP SIGNATURE-----\s*[\r\n].*'.
|
||||
'[\r\n]\s*-----END PGP SIGNATURE-----(.*)/is';
|
||||
|
||||
preg_match($pattern, $message, $result);
|
||||
if (preg_match($pattern, $message, $result)) {
|
||||
$cleaned = trim($result[1].$result[2].$result[3]);
|
||||
|
||||
$cleaned = trim($result[1].$result[2].$result[3]);
|
||||
|
||||
$cleaned = str_replace(["\n- --\n", "\n- -"], ["\n-- \n", "\n-"], $cleaned);
|
||||
|
||||
if ($cleaned == '') {
|
||||
$cleaned = str_replace(["\n- --\n", "\n- -"], ["\n-- \n", "\n-"], $cleaned);
|
||||
} else {
|
||||
$cleaned = $message;
|
||||
}
|
||||
|
||||
|
|
|
@ -1543,8 +1543,10 @@ class OStatus
|
|||
*/
|
||||
private static function constructObjecttype(array $item)
|
||||
{
|
||||
if (in_array($item['object-type'], [ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT]))
|
||||
if (!empty($item['object-type']) && in_array($item['object-type'], [ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT])) {
|
||||
return $item['object-type'];
|
||||
}
|
||||
|
||||
return ACTIVITY_OBJ_NOTE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1375,7 +1375,7 @@ class PortableContact
|
|||
$site_name = $data['site_name'];
|
||||
}
|
||||
|
||||
$info = $data['info'];
|
||||
$info = defaults($data, 'info', '');
|
||||
$register_policy = defaults($data, 'register_policy', REGISTER_CLOSED);
|
||||
if (in_array($register_policy, ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) {
|
||||
$register_policy = constant($data['register_policy']);
|
||||
|
@ -1383,7 +1383,7 @@ class PortableContact
|
|||
Logger::log("Register policy '$register_policy' from $server_url is invalid.");
|
||||
$register_policy = REGISTER_CLOSED; // set a default value
|
||||
}
|
||||
$platform = $data['platform'];
|
||||
$platform = defaults($data, 'platform', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue