From 8cabcda5e089a1a633e7feeba8e521abfe8632ba Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 22 Jun 2016 21:00:58 +0200 Subject: [PATCH] Always parse the first title element --- mod/parse_url.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/parse_url.php b/mod/parse_url.php index df5436b626..baf8677501 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -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]"); -- 2.39.5