Skip to content

Commit 8738d1d

Browse files
committed
fix: vulnerabilità minori
1 parent 3581edc commit 8738d1d

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

modules/checklists/modutil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function renderChecklist($check, $level = 1, $parent = 0, $has_images = false)
6161

6262
$result .= '
6363
<td style="border-top:0px;">
64-
<span class="text unblockable" style="'.(!empty($check->checked_at) ? 'text-decoration:line-through;' : '').'">'.$check->content.' </span>
64+
<span class="text unblockable" style="'.(!empty($check->checked_at) ? 'text-decoration:line-through;' : '').'">'.htmlspecialchars($check->content, ENT_QUOTES, 'UTF-8').' </span>
6565
</td>';
6666

6767
$result .= '

modules/fatture/modals/confronta_righe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
$id_anagrafica = $documento->idanagrafica;
2828
$direzione = $documento->direzione;
29-
$righe_ids = array_map('intval', explode(',', $_GET['righe'] ?? ''));
29+
$righe_ids = array_map('intval', explode(',', filter('righe') ?? ''));
3030
$placeholders = implode(',', array_fill(0, count($righe_ids), '?'));
3131
$righe = $dbo->fetchArray(
3232
'SELECT

modules/fatture/modutil.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,18 @@ function aggiungi_movimento($iddocumento, $dir, $primanota = 0)
308308
$importo_cliente = sum($importo_cliente, -$iva_fattura, 2);
309309
}
310310

311-
$query2 = 'INSERT INTO co_movimenti(idmastrino, data, iddocumento, id_anagrafica, descrizione, idconto, totale, primanota) VALUES('.prepare($idmastrino).', '.prepare($data).', '.prepare($iddocumento).", '', ".prepare($descrizione.' del '.date('d/m/Y', strtotime((string) $data)).' ('.$ragione_sociale.')').', '.prepare($idconto_controparte).', '.prepare(($importo_cliente + $totale_bolli) * $segno_mov1_cliente).', '.prepare($primanota).' )';
312-
$dbo->query($query2);
311+
$query2 = 'INSERT INTO co_movimenti(idmastrino, data, iddocumento, id_anagrafica, descrizione, idconto, totale, primanota) VALUES(:idmastrino, :data, :iddocumento, :id_anagrafica, :descrizione, :idconto, :totale, :primanota)';
312+
$params = [
313+
':idmastrino' => $idmastrino,
314+
':data' => $data,
315+
':iddocumento' => $iddocumento,
316+
':id_anagrafica' => '',
317+
':descrizione' => $descrizione.' del '.date('d/m/Y', strtotime((string) $data)).' ('.$ragione_sociale.')',
318+
':idconto' => $idconto_controparte,
319+
':totale' => ($importo_cliente + $totale_bolli) * $segno_mov1_cliente,
320+
':primanota' => $primanota,
321+
];
322+
$dbo->query($query2, $params);
313323

314324
// 2) Aggiungo il totale sul conto dei ricavi/spese scelto
315325
// Lettura descrizione conto ricavi/spese per ogni riga del documento

modules/interventi/modals/confronta_righe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
$id_anagrafica = $intervento->idanagrafica;
2828
$direzione = $intervento->direzione;
29-
$righe_ids = array_map('intval', explode(',', $_GET['righe'] ?? ''));
29+
$righe_ids = array_map('intval', explode(',', filter('righe') ?? ''));
3030
$placeholders = implode(',', array_fill(0, count($righe_ids), '?'));
3131
$righe = $dbo->fetchArray(
3232
'SELECT

oauth2.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
session_write_close();
2626

2727
// Authorization information
28-
$state = $_GET['state'];
29-
$code = $_GET['code'];
28+
$state = filter('state');
29+
$code = filter('code');
3030

3131
// Account individuato via state
3232
if (!empty($state)) {
@@ -57,10 +57,10 @@
5757
$redirect = $response['authorization_url'];
5858
}
5959

60-
if (empty($_GET['error'])) {
60+
if (empty(filter('error'))) {
6161
redirect_url($redirect);
6262
exit;
6363
}
64-
echo strip_tags($_GET['error']).'<br>'.strip_tags($_GET['error_description']).'
64+
echo strip_tags(filter('error')).'<br>'.strip_tags(filter('error_description')).'
6565
<br><br>
6666
<a href="'.$redirect.'">'.tr('Riprova').'</a>';

0 commit comments

Comments
 (0)