From abc4f047bf08ed2ff452085cb62355cf944cd72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Tue, 30 Aug 2016 00:20:35 +0200 Subject: [PATCH] [ZDNnetBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ZDNetBridge.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bridges/ZDNetBridge.php b/bridges/ZDNetBridge.php index 6925159..03f63ba 100644 --- a/bridges/ZDNetBridge.php +++ b/bridges/ZDNetBridge.php @@ -207,16 +207,12 @@ class ZDNetBridge extends BridgeAbstract { return $string; } - $baseUri = $this->getURI(); + $baseUri = $this->uri; $feed = $this->getInput('feed'); - if (empty($feed)) - $this->returnClientError('Please select a feed to display.'); if (strpos($feed, 'downloads!') !== false) { $feed = str_replace('downloads!', '', $feed); $baseUri = str_replace('www.', 'downloads.', $baseUri); } - if ($feed !== preg_replace('/[^a-zA-Z0-9-\/]+/', '', $feed) || substr_count($feed, '/') > 1 || strlen($feed > 64)) - $this->returnClientError('Invalid "feed" parameter.'); $url = $baseUri.trim($feed, '/').'/rss.xml'; $html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request ZDNet: '.$url); $limit = 0;