Apply suggestions from code review

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Michael Vogel 2020-09-29 05:56:57 +02:00 committed by GitHub
parent fb50a43ac0
commit 777ece84cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1795,9 +1795,9 @@ class DFRN
{ {
Logger::notice('Processing suggestions'); Logger::notice('Processing suggestions');
$url = $xpath->query('dfrn:url/text()', $suggestion)->item(0)->nodeValue; $url = $xpath->evaluate('string(dfrn:url[1]/text())', $suggestion);
$cid = Contact::getIdForURL($url); $cid = Contact::getIdForURL($url);
$note = $xpath->query('dfrn:note/text()', $suggestion)->item(0)->nodeValue; $note = $xpath->evaluate('string(dfrn:note[1]/text())', $suggestion);
return FContact::addSuggestion($importer['importer_uid'], $cid, $importer['id'], $note); return FContact::addSuggestion($importer['importer_uid'], $cid, $importer['id'], $note);
} }