1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-10 18:44:04 +02:00

test: add feed item test (#3709)

* test: add feed item test

also some refactor

* yup

* yup
This commit is contained in:
Dag
2023-09-25 22:32:15 +02:00
committed by GitHub
parent cd30c25b08
commit f421c45b21
10 changed files with 98 additions and 81 deletions

View File

@@ -73,6 +73,15 @@ class FilterBridge extends FeedExpander
],
]];
public function collectData()
{
$url = $this->getInput('url');
if (!Url::validate($url)) {
returnClientError('The url parameter must either refer to http or https protocol.');
}
$this->collectExpandableDatas($this->getURI());
}
protected function parseItem($newItem)
{
$item = parent::parseItem($newItem);
@@ -158,13 +167,4 @@ class FilterBridge extends FeedExpander
return $url;
}
public function collectData()
{
if ($this->getInput('url') && substr($this->getInput('url'), 0, 4) !== 'http') {
// just in case someone finds a way to access local files by playing with the url
returnClientError('The url parameter must either refer to http or https protocol.');
}
$this->collectExpandableDatas($this->getURI());
}
}