Fix Security: Stored Cross Site Scripting for static QR code, see https://github.com/giandonatoinverso/PHP-Dynamic-Qr-code/issues/93

This commit is contained in:
Minh Cuong Tran
2024-03-01 08:03:31 +01:00
parent 5488ad0a84
commit b03238b4c3
+1 -1
View File
@@ -355,7 +355,7 @@ class StaticQrcode {
$data_to_db['type'] = $type; $data_to_db['type'] = $type;
$data_to_db['format'] = $_POST['format']; $data_to_db['format'] = $_POST['format'];
$data_to_db['qrcode'] = $data_to_db['filename'].'.'.$data_to_db['format']; $data_to_db['qrcode'] = $data_to_db['filename'].'.'.$data_to_db['format'];
$data_to_db['content'] = $this->sContent; $data_to_db['content'] = htmlspecialchars($this->sContent, ENT_QUOTES, 'UTF-8');
if(isset($_POST['level'])) if(isset($_POST['level']))
$input_data["level"] = $_POST['level']; $input_data["level"] = $_POST['level'];