The flash messenger replaces the message spaces with the " + " symbol when trying to create something, but it works perfectly when updating.
How to remove the " + " symbol?
code for creating
// success
$text = $this->translate('The group %s has been created successfully.');
$message['success'] = sprintf($text, $group['name']);
$cookie = new SetCookie('newGroup', $group['name'], time() + 30, '/');
$this->getResponse()->getHeaders()->addHeader($cookie);
if (isset($post['isAPIData']) && $post['isAPIData'] == 1) {
$isAPIResponse = 1;
} else {
if (!$request->isXmlHttpRequest()) {
$this->flashMessenger()->addSuccessMessage($message['success']);
return $this->redirect()->refresh();
}
}
code for updating
// success
$text = $this->translate('The group %s has been updated successfully.');
$message['success'] = sprintf($text, $group['name']);
if (isset($post['isAPIData']) && $post['isAPIData'] == 1) {
$isAPIResponse = 1;
return [
'message' => $message,
'isAPIResponse' => $isAPIResponse
];
} else {
if (!$request->isXmlHttpRequest()) {
$this->flashMessenger()->addSuccessMessage($message['success']);
$this->redirect()->refresh();
}
}
when var_dump($message['success']) the output is correct ![var_dump($message['success']) output](https://i.stack.imgur.com/csgIE.png)
how to fix this?

