diff --git a/src/app/history/controllers/HistoryController.php b/src/app/history/controllers/HistoryController.php index 1c98e84b6339be9d36ab6684a35fd5e671d4eb55..fcac24ab1b519362a4dacae14ea0a5165a5eadeb 100755 --- a/src/app/history/controllers/HistoryController.php +++ b/src/app/history/controllers/HistoryController.php @@ -476,17 +476,17 @@ class HistoryController if (empty($adr[0])) { continue; } - + $docserver = DocserverModel::getByType(['type' => $adr[0]['type'], 'select' => ['path']]); if (empty($docserver['path']) || !file_exists($docserver['path'])) { return $response->withStatus(400)->withJson(['errors' => 'Docserver does not exist']); } - + $pathToDocument = $docserver['path'] . $adr[0]['path'] . $adr[0]['filename']; if (!is_file($pathToDocument)) { return $response->withStatus(404)->withJson(['errors' => 'Document not found on docserver']); } - + $fingerprint = DocserverController::getFingerPrint(['path' => $pathToDocument]); if ($adr[0]['fingerprint'] != $fingerprint) { return $response->withStatus(400)->withJson(['errors' => 'Fingerprint do not match']); @@ -497,7 +497,7 @@ class HistoryController ]); $documentPathToZip[] = ['path' => $pathToDocument, 'filename' => 'attachment_' . $key . '_' . $filename]; } - + $notes = []; $documentNotes = json_decode($document['notes'], true); if (!empty($documentNotes)) { @@ -583,17 +583,17 @@ class HistoryController $args['xml'] = new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><root></root>', null, false); $historyNode = 'History'; } - + foreach ($args['data'] as $key => $value) { $node = $historyNode ?? $key; if (is_array($value)) { - HistoryController::arrayToXml(['data' => $value, 'xml' => $args['xml']->addChild(str_replace(' ', '', $node))]); + HistoryController::arrayToXml(['data' => $value, 'xml' => $args['xml']->addChild(str_replace([' ','(',')'], '', $node))]); } else { - $args['xml']->addChild(str_replace(' ', '', $node), $value); + $args['xml']->addChild(str_replace([' ','(',')'], '', $node), $value); } } - + return $args['xml']->asXML(); }