Merge pull request #5314 from MrPetovan/task/4889-fix-tests

Fix tests after enabling PHP Notices
This commit is contained in:
Michael Vogel 2018-07-06 22:14:01 +02:00 committed by GitHub
commit 3eec97aa6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 348 additions and 268 deletions

View file

@ -61,7 +61,7 @@ class Conversation
unset($old_conv['source']);
}
// Update structure data all the time but the source only when its from a better protocol.
if (($old_conv['protocol'] < $conversation['protocol']) && ($old_conv['protocol'] != 0)) {
if (isset($conversation['protocol']) && isset($conversation['source']) && ($old_conv['protocol'] < $conversation['protocol']) && ($old_conv['protocol'] != 0)) {
unset($conversation['protocol']);
unset($conversation['source']);
}

View file

@ -809,7 +809,9 @@ class Item extends BaseObject
// If item has attachments, drop them
foreach (explode(", ", $item['attach']) as $attach) {
preg_match("|attach/(\d+)|", $attach, $matches);
dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
if (is_array($matches) && count($matches) > 1) {
dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
}
}
// Delete tags that had been attached to other items
@ -1997,7 +1999,7 @@ class Item extends BaseObject
Contact::unmarkForArchival($contact);
}
$update = (!$arr['private'] && (($arr["author-link"] === $arr["owner-link"]) || ($arr["parent-uri"] === $arr["uri"])));
$update = (!$arr['private'] && ((defaults($arr, 'author-link', '') === defaults($arr, 'owner-link', '')) || ($arr["parent-uri"] === $arr["uri"])));
// Is it a forum? Then we don't care about the rules from above
if (!$update && ($arr["network"] == NETWORK_DFRN) && ($arr["parent-uri"] === $arr["uri"])) {