diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-23 23:29:59 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-23 23:29:59 +0200 |
| commit | 126a49185229f248eae8c485b3e16e029ebcb353 (patch) | |
| tree | 7877918b7067103d667d522883e04f0129a1addc /src/Controller/HeadFootController.php | |
| parent | 5a25142d778eafdec33d10d673bd4abc5fe38d1c (diff) | |
| download | cms-polo1.tar.gz cms-polo1.tar.bz2 cms-polo1.zip | |
audit claude code 1, validation formulaire toujours ok, échappement dans URL, quelques htmlspecialchars manquants, fonction Security::validateURLpolo1
Diffstat (limited to 'src/Controller/HeadFootController.php')
| -rw-r--r-- | src/Controller/HeadFootController.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Controller/HeadFootController.php b/src/Controller/HeadFootController.php index e39c07b..2bf210e 100644 --- a/src/Controller/HeadFootController.php +++ b/src/Controller/HeadFootController.php | |||
| @@ -28,14 +28,19 @@ class HeadFootController | |||
| 28 | $node_data = $model->getNode()->getNodeData(); | 28 | $node_data = $model->getNode()->getNodeData(); |
| 29 | 29 | ||
| 30 | // liens réseaux sociaux | 30 | // liens réseaux sociaux |
| 31 | $link = trim($json['new_text'] ?? ''); // trim n'aime pas recevoir un NULL | ||
| 31 | if(in_array($params_array[1], NodeData::$social_networks)){ | 32 | if(in_array($params_array[1], NodeData::$social_networks)){ |
| 33 | if($link !== '' && !Security::validateURL($link)){ | ||
| 34 | return new JsonResponse(['success' => false, 'error' => 'invalid_url']); | ||
| 35 | } | ||
| 36 | |||
| 32 | $social = $node_data->getData()['social'] ?? []; | 37 | $social = $node_data->getData()['social'] ?? []; |
| 33 | $social[$params_array[1]] = $json['new_text']; | 38 | $social[$params_array[1]] = $link; |
| 34 | $node_data->updateData('social', $social); | 39 | $node_data->updateData('social', $social); |
| 35 | } | 40 | } |
| 36 | // autres textes | 41 | // autres textes |
| 37 | else{ | 42 | else{ |
| 38 | $node_data->updateData($params_array[1], $json['new_text']); // $params_array[1] n'est pas contrôlé | 43 | $node_data->updateData($params_array[1], $link); // $params_array[1] n'est pas contrôlé |
| 39 | } | 44 | } |
| 40 | 45 | ||
| 41 | $entityManager->flush(); | 46 | $entityManager->flush(); |
