[Scrutinizer] Fix undeclared variables in src/Protocol/

- Use dba::selectFirst to remove intermediate variables `$r`
- Remove unused variable `$sender` in Protocol\Email
- Simplify Protocol\OStatus:fetchAuthor cascading queries
This commit is contained in:
Hypolite Petovan 2018-02-13 23:58:46 -05:00
parent 2234bb92ae
commit d8e9ed5ff8
6 changed files with 78 additions and 98 deletions

View file

@ -68,6 +68,7 @@ class Feed {
$xpath->registerNamespace('poco', NAMESPACE_POCO);
$author = [];
$entries = null;
// Is it RDF?
if ($xpath->query('/rdf:RDF/rss:channel')->length > 0) {
@ -369,9 +370,8 @@ class Feed {
$item["title"] = '';
}
$preview = '';
if (!empty($contact["fetch_further_information"]) && ($contact["fetch_further_information"] < 3)) {
$preview = "";
// Handle enclosures and treat them as preview picture
foreach ($attachments AS $attachment) {
if ($attachment["type"] == "image/jpeg") {
@ -410,6 +410,7 @@ class Feed {
if (!empty($tags)) {
$item["tag"] = $tags;
} else {
// @todo $preview is never set in this case, is it intended? - @MrPetovan 2018-02-13
$item["tag"] = add_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"]);
}
$item["body"] .= "\n".$item['tag'];