From a26186f44342af52ee2b752930445e0b3c46ba9e Mon Sep 17 00:00:00 2001 From: Timo Schmidt Date: Tue, 20 Sep 2016 19:45:52 +0200 Subject: Implementation for issue https://github.com/nextcloud/news/issues/38 Instead of the array return type use component parameter PHP_URL_HOST to get the host part from the URL as string. This avoids an undefined index warning if host part could not be found. --- lib/Db/Feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Db/Feed.php b/lib/Db/Feed.php index 1fdcf13fb..974f2ed8c 100644 --- a/lib/Db/Feed.php +++ b/lib/Db/Feed.php @@ -137,7 +137,7 @@ class Feed extends Entity implements IAPI, \JsonSerializable { 'basicAuthPassword' ]); - $url = parse_url($this->link)['host']; + $url = parse_url($this->link, PHP_URL_HOST); // strip leading www. to avoid css class confusion if (strpos($url, 'www.') === 0) { -- cgit v1.2.3