Anomalie #12432
IPARAPHEUR - Réponses non récupérées lorsqu'une note comporte un saut de ligne
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 3 years ago
- Status changed from A traiter to Prêt à embarquer
#3 Updated by Emmanuel DILLARD over 3 years ago
- Priority changed from 2-Sérieux to 1-Majeur
#4 Updated by Emmanuel DILLARD over 3 years ago
- Project changed from Backlog to CURRENT SPRINT
- Status changed from Prêt à embarquer to En cours (Sprint)
- Tags Courrier 18.10.13, 19.04.11 added
#5 Updated by Florian AZIZIAN over 3 years ago
- Target version set to 20.03 (Fin de vie)
#7 Updated by Emmanuel DILLARD over 3 years ago
- Project changed from CURRENT SPRINT to Backlog
- Status changed from En cours (Sprint) to Développé / Analysé
#11 Updated by Emmanuel DILLARD almost 2 years ago
- Project changed from Backlog to Backlog Courrier
- Target version changed from 20.03 (Fin de vie) to 20.03 (Sécurité)