From 292f0f85ada51234cd9535337f83b9eb31ce4468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sat, 27 Aug 2016 15:41:42 +0200 Subject: [PATCH] [ParuVenduImmoBridge] fix undefined $param variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and remove useless member $request Signed-off-by: Pierre Mazière --- bridges/ParuVenduImmoBridge.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bridges/ParuVenduImmoBridge.php b/bridges/ParuVenduImmoBridge.php index 345ef97..bb0a77b 100644 --- a/bridges/ParuVenduImmoBridge.php +++ b/bridges/ParuVenduImmoBridge.php @@ -2,8 +2,6 @@ class ParuVenduImmoBridge extends BridgeAbstract { - private $request = ''; - public function loadMetadatas() { $this->maintainer = "polo2ro"; @@ -31,6 +29,7 @@ class ParuVenduImmoBridge extends BridgeAbstract public function collectData() { + $param=$this->parameters[$this->queriedContext]; $html = ''; $num = 20; $appartment = '&tbApp=1&tbDup=1&tbChb=1&tbLof=1&tbAtl=1&tbPla=1'; @@ -38,7 +37,6 @@ class ParuVenduImmoBridge extends BridgeAbstract $link = $this->uri.'/immobilier/annonceimmofo/liste/listeAnnonces?tt=1'.$appartment.$maison; if (isset($param['minarea']['value'])) { - $this->request .= ' '.$param['minarea']['value'].' m2'; $link .= '&sur0='.urlencode($param['minarea']['value']); } @@ -51,7 +49,6 @@ class ParuVenduImmoBridge extends BridgeAbstract } if (isset($param['lo']['value'])) { - $this->request .= ' In: '.$param['lo']['value']; $link .= '&lo='.urlencode($param['lo']['value']); } @@ -88,7 +85,18 @@ class ParuVenduImmoBridge extends BridgeAbstract } public function getName(){ - return 'Paru Vendu Immobilier'.$this->request; + $param=$this->parameters[$this->queriedContext]; + $request=''; + if(isset($param['minarea']['value']) && + !empty($param['minarea']['value']) + ){ + $request .= ' '.$param['minarea']['value'].' m2'; + } + if(isset($param['lo']['value']) && + !empty($param['lo']['value'])){ + $request .= ' In: '.$param['lo']['value']; + } + return 'Paru Vendu Immobilier'.$request; } public function getCacheDuration(){