From: vincent@cubedesigners.com Date: Tue, 18 Dec 2018 15:23:49 +0000 (+0000) Subject: fix #2450 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=30cde5ab2a3317fe06dea32570b6d829ababc53a;p=cubeextranet.git fix #2450 @1 --- diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 1b6e0e1d7..afbf6bf6f 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -2135,19 +2135,31 @@ html{height:100%}' . "\n"; { $ref = $args[1]; + try { + $adapter = new Zend_Http_Client_Adapter_Socket(); + $streamOpts = array( + 'ssl' => array( + 'verify_peer' => false, + 'allow_self_signed' => true + ) + ); + $adapter->setStreamContext($streamOpts); $client = new Zend_Http_Client(); - $client->setAdapter('Zend_Http_Client_Adapter_Socket'); + $client->setAdapter($adapter); $client->setEncType(Zend_Http_Client::ENC_FORMDATA); $client->setMethod(Zend_Http_Client::POST); $client->setParameterPost(array('reference' => $ref)); $client->setUri('https://www.orpi.com/recherche/search_by_reference'); - $client->setHeaders(array('X-Requested-With' => 'XMLHttpRequest')); - + $client->setHeaders(['X-Requested-With' => 'XMLHttpRequest', + 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0', + 'Origin' => 'https://www.orpi.com', + 'Referer' => 'https://www.orpi.com/', + 'Pragma' => 'no-cache', + 'DNT' => '1']); $response = $client->request(); $json = $response->getBody(); $res = 'https://www.orpi.com'; - echo $json; if ($json === false) { header('Location: ' . $res); exit; @@ -2165,8 +2177,10 @@ html{height:100%}' . "\n"; header('Location: ' . $res); } catch (Exception $e) { + ob_end_clean(); echo $e->getMessage(); } - die(''); + + //header('Location: https://www.orpi.com/'); } }