From 945b71d6af8f69d1277d754b924368fa631ec998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Barouty?= Date: Fri, 8 Jun 2018 23:38:44 +0200 Subject: [PATCH] FIX: Link does not work when there is spaces in SIREN (like in the main format) --- htdocs/societe/class/societe.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5492a640db1..56cd37dc7d8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3012,20 +3012,21 @@ class Societe extends CommonObject } // TODO Move links to validate professional ID into a dictionary table "country" + "link" + $strippedIdProf1 = str_replace(' ', '', $thirdparty->idprof1); if ($idprof == 1 && $thirdparty->country_code == 'FR') { - $url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/ + $url='http://www.societe.com/cgi-bin/search?champs='.$strippedIdProf1; // See also http://avis-situation-sirene.insee.fr/ } if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) { - $url='https://beta.companieshouse.gov.uk/company/'.$thirdparty->idprof1; + $url='https://beta.companieshouse.gov.uk/company/'.$strippedIdProf1; } if ($idprof == 1 && $thirdparty->country_code == 'ES') { - $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1; + $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$strippedIdProf1; } if ($idprof == 1 && $thirdparty->country_code == 'IN') { - $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; + $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$strippedIdProf1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; } if ($idprof == 1 && $thirdparty->country_code == 'PT') { - $url='http://www.nif.pt/'.$thirdparty->idprof1; + $url='http://www.nif.pt/'.$strippedIdProf1; } if ($url) {