Project

General

Profile

Anomalie #12432

IPARAPHEUR - Réponses non récupérées lorsqu'une note comporte un saut de ligne

Added by Support Maarch over 2 years ago. Updated 12 months ago.

Status:
Développé / Analysé (S)
Priority:
1-Majeur
Assignee:
Target version:
Start date:
11/20/2019
Due date:
Tags Courrier:
18.10.13, 19.04.11

Description

/var/www/html/MaarchCourrier1810/src/core/models/CurlModel.php l138
...
if (empty($body)) {
$body = explode(PHP_EOL, $rawResponse)[5];
...

$rawResponse représente le contenu de la requête curl.
les 4 premiers éléments de explode(PHP_EOL, $rawResponse) sont les headers
et le dernier élément une méta info également.
Si le contenu de la réponse comporte un saut de ligne, la requête est tronquée et donc plus interprétable.

Fix appliqué au SITIV (le bug bloquait les retours des parapheurs de l'instance de Corbas)

$cookies = [];
if (!empty($aArgs['options'][CURLOPT_HEADER])) {
preg_match_all('/Set-Cookie:\s*([;]*)/mi', $rawResponse, $matches);
foreach ($matches[1] as $item) {
$cookie = explode("=", $item);
$cookies = array_merge($cookies, [$cookie[0] => $cookie[1]]);
}
$rawResponse = substr($rawResponse, $infos['header_size']);
} elseif (!empty($aArgs['delete_header'])) { // Delete header for iparapheur
$body = explode(PHP_EOL . PHP_EOL, $rawResponse)[1]; // put the header ahead
if (empty($body)) {
//$body = explode(PHP_EOL, $rawResponse)[5];
$body = explode(PHP_EOL, $rawResponse);
// we remove the 4 starting item of the array (header)
for($i =0; $i < 5; $i++) array_shift($body);
// and the last item (footer)
array_pop($body);
$body = join('', $body);
}
$pattern = '/--uuid:[0-9a-f-]+--/'; // And also the footer
$rawResponse = preg_replace($pattern, '', $body);
}

History

#2 Updated by Emmanuel DILLARD over 2 years ago

  • Status changed from A traiter to Prêt à développer

#3 Updated by Emmanuel DILLARD over 2 years ago

  • Priority changed from 2-Sérieux to 1-Majeur

#4 Updated by Emmanuel DILLARD over 2 years ago

  • Project changed from Backlog to CURRENT SPRINT
  • Status changed from Prêt à développer to En cours de dev (S)
  • Tags Courrier 18.10.13, 19.04.11 added

#5 Updated by Florian AZIZIAN over 2 years ago

  • Target version set to 20.03 (Support restreint)

#7 Updated by Emmanuel DILLARD over 2 years ago

  • Project changed from CURRENT SPRINT to Backlog
  • Status changed from En cours de dev (S) to Développé / Analysé (S)

#11 Updated by Emmanuel DILLARD 12 months ago

  • Project changed from Backlog to Backlog Courrier
  • Target version changed from 20.03 (Support restreint) to 20.03 (Restreint)

Also available in: Atom PDF