diff options
-rw-r--r-- | appinfo/application.php | 11 | ||||
-rw-r--r-- | fetcher/feedfetcher.php | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/appinfo/application.php b/appinfo/application.php index d541a4f81..af9b93a09 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -414,14 +414,15 @@ class Application extends App { $appConfig = $c->query('AppConfig'); $proxy = $c->query('ProxyConfigParser'); + $userAgent = 'ownCloud News/' . $appConfig->getConfig('version') . + ' (+https://owncloud.org/; 1 subscriber;)'; + $pico = new PicoFeedConfig(); - $pico->setClientUserAgent( - 'ownCloud News/' . $appConfig->getConfig('version') . - ' (+https://owncloud.org/; 1 subscriber;)' - ) + $pico->setClientUserAgent($userAgent) ->setClientTimeout($config->getFeedFetcherTimeout()) ->setMaxRedirections($config->getMaxRedirects()) - ->setContentFiltering(false); + ->setContentFiltering(false) + ->setParserHashAlgo('md5'); // proxy settings $proxySettings = $proxy->parse(); diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php index b7ddce91a..2a7b9bc4e 100644 --- a/fetcher/feedfetcher.php +++ b/fetcher/feedfetcher.php @@ -132,7 +132,8 @@ class FeedFetcher implements IFeedFetcher { // purification is done in the service layer $body = $parsedItem->getContent(); - $body = mb_convert_encoding($body, 'HTML-ENTITIES', 'UTF-8'); + $body = mb_convert_encoding($body, 'HTML-ENTITIES', + mb_detect_encoding($body)); $item->setBody($body); // pubdate is not required. if not given use the current date |