Import backlog on new subscription.

Danger is when importing a new feed that may be maliciously crafted
to contain a zillion entries.
This commit is contained in:
Mikael Nordfeldth
2017-04-21 09:31:27 +02:00
parent f51cb6fca9
commit e98bceec10
3 changed files with 33 additions and 3 deletions

View File

@@ -53,9 +53,11 @@ if (!$sub) {
exit(1);
}
// XXX: This could maybe be replaced with $sub->importFeed()
// Fetch the URL
try {
$xml = HTTPClient::quickGet($feedurl, 'text/html,application/xhtml+xml');
$xml = HTTPClient::quickGet($feedurl, 'application/atom+xml');
} catch (Exception $e) {
echo sprintf("Could not fetch feedurl %s (%d).\n", $e->getMessage(), $e->getCode());
exit(1);