From ae958897279a40a99e94a71814ffa88261d9f230 Mon Sep 17 00:00:00 2001 From: Tomasz Wolniewicz Date: Wed, 27 Nov 2024 21:40:46 +0100 Subject: [PATCH] fixing bug caused by not escaping double quetes --- web/admin/duplicate_profile_result.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/admin/duplicate_profile_result.php b/web/admin/duplicate_profile_result.php index 0ce06186e..7e8b60f3c 100644 --- a/web/admin/duplicate_profile_result.php +++ b/web/admin/duplicate_profile_result.php @@ -36,6 +36,7 @@ $auth = new \web\lib\admin\Authentication(); $auth->authenticate(); + function copyRow($row, $feldsArray, $table, $dbHandle) { $fieldsList = implode(',', array_keys($row)); foreach ($row as $key => $value) { @@ -43,7 +44,9 @@ function copyRow($row, $feldsArray, $table, $dbHandle) { if ($value === null) { $row[$key] = 'NULL'; } else { - $row[$key] = '"'.$value.'"'; + $e1 = str_replace('\\', '\\\\', $value); + $e2 = str_replace('"', '\"', $e1); + $row[$key] = '"'.$e2.'"'; } } }