]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #2632 from annando/1606-parse-title
authorrabuzarus <rabuzarus@t-online.de>
Thu, 23 Jun 2016 08:18:58 +0000 (10:18 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Jun 2016 08:18:58 +0000 (10:18 +0200)
Always parse the first title element

mod/parse_url.php

index df5436b6261add605a703567f225906ea827a004..baf86775010a8360a7e09c451efc3f3ee3303905 100644 (file)
@@ -235,10 +235,9 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co
                }
        }
 
-       //$list = $xpath->query("head/title");
        $list = $xpath->query("//title");
-       foreach ($list as $node)
-               $siteinfo["title"] =  html_entity_decode($node->nodeValue, ENT_QUOTES, "UTF-8");
+       if ($list->length > 0)
+               $siteinfo["title"] = $list->item(0)->nodeValue;
 
        //$list = $xpath->query("head/meta[@name]");
        $list = $xpath->query("//meta[@name]");