mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-04-25 20:15:47 +02:00
Workaround for #2048
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:
parent
343aa5e2f7
commit
0dfd93f75d
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user