mirror of
https://github.com/friendica/friendica
synced 2025-05-01 23:04:24 +02:00
Fix potential bugs without expected behavior change
- Fix uninitialized variables - Fix potentially not set variables - Fix wrong parameter default value - Fix method scope - Fix missing return value
This commit is contained in:
parent
45ada943b4
commit
7f2dc40601
35 changed files with 87 additions and 67 deletions
|
@ -232,7 +232,7 @@ class Attach extends BaseObject
|
|||
* @return boolean True on success
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function storeFile($src, $uid, $filename = '', $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '')
|
||||
public static function storeFile($src, $uid, $filename = '', $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '')
|
||||
{
|
||||
if ($filename === '') {
|
||||
$filename = basename($src);
|
||||
|
|
|
@ -35,12 +35,6 @@ class Contact extends BaseObject
|
|||
* @deprecated since version 2019.03
|
||||
* @see User::PAGE_FLAGS_NORMAL
|
||||
*/
|
||||
const PAGE_NORMAL = 0;
|
||||
const PAGE_SOAPBOX = 1;
|
||||
const PAGE_COMMUNITY = 2;
|
||||
const PAGE_FREELOVE = 3;
|
||||
const PAGE_BLOG = 4;
|
||||
const PAGE_PRVGROUP = 5;
|
||||
const PAGE_NORMAL = User::PAGE_FLAGS_NORMAL;
|
||||
/**
|
||||
* @deprecated since version 2019.03
|
||||
|
@ -1205,9 +1199,10 @@ class Contact extends BaseObject
|
|||
$contact = DBA::selectFirst('contact', $fields, ['addr' => $url]);
|
||||
}
|
||||
|
||||
// The link could be provided as http although we stored it as https
|
||||
$ssl_url = str_replace('http://', 'https://', $url);
|
||||
|
||||
if (!DBA::isResult($contact)) {
|
||||
// The link could be provided as http although we stored it as https
|
||||
$ssl_url = str_replace('http://', 'https://', $url);
|
||||
$condition = ['alias' => [$url, Strings::normaliseLink($url), $ssl_url]];
|
||||
$contact = DBA::selectFirst('contact', $fields, $condition);
|
||||
}
|
||||
|
@ -1426,7 +1421,7 @@ class Contact extends BaseObject
|
|||
{
|
||||
$a = self::getApp();
|
||||
|
||||
$cid = Self::getIdForURL($contact_url);
|
||||
$cid = self::getIdForURL($contact_url);
|
||||
|
||||
$contact = DBA::selectFirst('contact', ['contact-type', 'network'], ['id' => $cid]);
|
||||
if (!DBA::isResult($contact)) {
|
||||
|
|
|
@ -77,7 +77,7 @@ class Conversation
|
|||
}
|
||||
// Update structure data all the time but the source only when its from a better protocol.
|
||||
if (empty($conversation['source']) || (!empty($old_conv['source']) &&
|
||||
($old_conv['protocol'] < defaults($conversation, 'protocol', PARCEL_UNKNOWN)))) {
|
||||
($old_conv['protocol'] < defaults($conversation, 'protocol', self::PARCEL_UNKNOWN)))) {
|
||||
unset($conversation['protocol']);
|
||||
unset($conversation['source']);
|
||||
}
|
||||
|
|
|
@ -48,8 +48,10 @@ class Event extends BaseObject
|
|||
}
|
||||
|
||||
if ($simple) {
|
||||
$o = '';
|
||||
|
||||
if (!empty($event['summary'])) {
|
||||
$o = "<h3>" . BBCode::convert(Strings::escapeHtml($event['summary']), false, $simple) . "</h3>";
|
||||
$o .= "<h3>" . BBCode::convert(Strings::escapeHtml($event['summary']), false, $simple) . "</h3>";
|
||||
}
|
||||
|
||||
if (!empty($event['desc'])) {
|
||||
|
|
|
@ -1252,6 +1252,8 @@ class Item extends BaseObject
|
|||
{
|
||||
$orig_item = $item;
|
||||
|
||||
$priority = PRIORITY_HIGH;
|
||||
|
||||
// If it is a posting where users should get notifications, then define it as wall posting
|
||||
if ($notify) {
|
||||
$item['wall'] = 1;
|
||||
|
@ -1261,8 +1263,6 @@ class Item extends BaseObject
|
|||
|
||||
if (is_int($notify)) {
|
||||
$priority = $notify;
|
||||
} else {
|
||||
$priority = PRIORITY_HIGH;
|
||||
}
|
||||
} else {
|
||||
$item['network'] = trim(defaults($item, 'network', Protocol::PHANTOM));
|
||||
|
@ -1850,7 +1850,7 @@ class Item extends BaseObject
|
|||
$cmd = 'wall-new';
|
||||
}
|
||||
|
||||
Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', $cmd, $current_post);
|
||||
Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $cmd, $current_post);
|
||||
}
|
||||
|
||||
return $current_post;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue