From 836eb8c038f846479973b11b39ad874801cc440e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 28 Aug 2016 20:10:45 +0200 Subject: [PATCH] [FuturaSciencesBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/FuturaSciencesBridge.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bridges/FuturaSciencesBridge.php b/bridges/FuturaSciencesBridge.php index cc252b86..3a91467e 100644 --- a/bridges/FuturaSciencesBridge.php +++ b/bridges/FuturaSciencesBridge.php @@ -136,12 +136,9 @@ class FuturaSciencesBridge extends BridgeAbstract { } $url = $this->getURI().'rss/'.$this->getInput('feed').'.xml'; - if (empty($this->getInput('feed'))) - $this->returnClientError('Please select a feed to display.'.$url); - if ($this->getInput('feed') !== preg_replace('/[^a-zA-Z-\/]+/', '', $this->getInput('feed')) || substr_count($this->getInput('feed'), '/') > 1 || strlen($this->getInput('feed') > 64)) - $this->returnClientError('Invalid "feed" parameter.'.$url); - $html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request Futura-Sciences: '.$url); + $html = $this->getSimpleHTMLDOM($url) + or $this->returnServerError('Could not request Futura-Sciences: '.$url); $limit = 0; foreach($html->find('item') as $element) {