1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-04-25 20:15:47 +02:00

Workaround for

The league/uri version that we inherit in Nextcloud is a bit outdated.
That version can't handle certain uris.

Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
Benjamin Brahmer 2023-01-10 12:28:10 +01:00
parent 343aa5e2f7
commit 0dfd93f75d
2 changed files with 7 additions and 1 deletions

View File

@ -7,6 +7,7 @@ The format is mostly based on [Keep a Changelog](https://keepachangelog.com/en/1
### Changed
### Fixed
- SyntaxError triggered when full-text is enabled with some items. (#2048, #2053)
# Releases
## [20.0.0] - 2022-12-14

View File

@ -14,6 +14,7 @@ namespace OCA\News\Scraper;
use fivefilters\Readability\Readability;
use fivefilters\Readability\Configuration;
use fivefilters\Readability\ParseException;
use League\Uri\Exceptions\SyntaxError;
use Psr\Log\LoggerInterface;
class Scraper implements IScraper
@ -74,10 +75,14 @@ class Scraper implements IScraper
try {
$this->readability->parse($content);
} catch (ParseException $e) {
} catch (ParseException | SyntaxError $e) {
$this->logger->error('Unable to parse content from {url}', [
'url' => $url,
]);
$this->logger->debug('Error during parsing of {url} ran into {error}', [
'url' => $url,
'error' => $e,
]);
}
return true;
}