mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Fix de failles xss et limitation des messages dans une discussion à 25
This commit is contained in:
parent
db1b5c35d8
commit
91c25fd917
2 changed files with 15 additions and 12 deletions
|
@ -82,8 +82,8 @@
|
|||
foreach ($sendeds as $sended)
|
||||
{
|
||||
$messages[] = array(
|
||||
'date' => $sended['at'],
|
||||
'text' => $sended['content'],
|
||||
'date' => htmlspecialchars($sended['at']),
|
||||
'text' => htmlspecialchars($sended['content']),
|
||||
'type' => 'sended',
|
||||
);
|
||||
}
|
||||
|
@ -91,8 +91,8 @@
|
|||
foreach ($receiveds as $received)
|
||||
{
|
||||
$messages[] = array(
|
||||
'date' => $received['at'],
|
||||
'text' => $received['content'],
|
||||
'date' => htmlspecialchars($received['at']),
|
||||
'text' => htmlspecialchars($received['content']),
|
||||
'type' => 'received',
|
||||
);
|
||||
}
|
||||
|
@ -100,8 +100,8 @@
|
|||
foreach ($scheduleds as $scheduled)
|
||||
{
|
||||
$messages[] = array(
|
||||
'date' => $scheduled['at'],
|
||||
'text' => $scheduled['content'],
|
||||
'date' => htmlspecialchars($scheduled['at']),
|
||||
'text' => htmlspecialchars($scheduled['content']),
|
||||
'type' => 'inprogress',
|
||||
);
|
||||
}
|
||||
|
@ -111,6 +111,9 @@
|
|||
return strtotime($a["date"]) - strtotime($b["date"]);
|
||||
});
|
||||
|
||||
//On récupère uniquement les 25 derniers messages sur l'ensemble
|
||||
$messages = array_slice($messages, -25);
|
||||
|
||||
echo json_encode(['transactionId' => $transactionId, 'messages' => $messages]);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue