From 9d7e64fac0d04e75221ebcadc4c6e643f6115760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Tue, 30 Aug 2016 00:31:59 +0200 Subject: [PATCH] [WorldOfTanksBridge] fix getName() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/WorldOfTanksBridge.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bridges/WorldOfTanksBridge.php b/bridges/WorldOfTanksBridge.php index deda7167..8b0ec838 100644 --- a/bridges/WorldOfTanksBridge.php +++ b/bridges/WorldOfTanksBridge.php @@ -26,6 +26,8 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{ ) )); + private $title=''; + function getURI(){ $lang = $this->getInput('lang'); $uri = $this->uri.$lang.'/news/'; @@ -35,12 +37,16 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{ return $uri; } + public function getName(){ + return $this->title?:$this->name; + } + public function collectData(){ $html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request '.$this->getURI()); $this->debugMessage("loaded HTML from ".$this->getURI()); // customize name - $this->name = $html->find('title', 0)->innertext; + $this->title = $html->find('title', 0)->innertext; foreach($html->find('.b-imgblock_ico') as $infoLink) { $this->parseLine($infoLink); }