]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions from code review
authorMichael Vogel <icarus@dabo.de>
Tue, 29 Sep 2020 03:56:57 +0000 (05:56 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Sep 2020 03:56:57 +0000 (05:56 +0200)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
src/Protocol/DFRN.php

index cfbf12c784e79b5593016223c396d98411df4c25..31e6173870b4ddbfe77299214a139187501f92ce 100644 (file)
@@ -1795,9 +1795,9 @@ class DFRN
        {
                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);
-               $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);
        }