Skip to content

Commit

Permalink
System: replaced unserialize with json_decode in Import from File
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Jan 22, 2024
1 parent 7367fee commit ec95a1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ v27.0.00

Bug Fixes
System: fixed PHP 8+ compatibility in CustomFieldIDs migration file
System: fixed input serialization of form data in Import from File page
Students: fixed the view all option in the Students by Form Group report

Deprecations
Expand Down
8 changes: 4 additions & 4 deletions modules/System Admin/import_run.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@

$csvData = $_POST['csvData'] ?? null;
if ($step==4) {
$columnOrder = isset($_POST['columnOrder'])? unserialize($_POST['columnOrder']) : null;
$columnText = isset($_POST['columnText'])? unserialize($_POST['columnText']) : null;
$columnOrder = isset($_POST['columnOrder'])? json_decode($_POST['columnOrder'], true) : null;
$columnText = isset($_POST['columnText'])? json_decode($_POST['columnText'], true) : null;
} else {
$columnOrder = $_POST['columnOrder'] ?? null;
$columnText = $_POST['columnText'] ?? null;
Expand Down Expand Up @@ -516,8 +516,8 @@
$form->addHiddenValue('mode', $mode);
$form->addHiddenValue('syncField', $syncField);
$form->addHiddenValue('syncColumn', $syncColumn);
$form->addHiddenValue('columnOrder', serialize($columnOrder));
$form->addHiddenValue('columnText', serialize($columnText));
$form->addHiddenValue('columnOrder', json_encode($columnOrder));
$form->addHiddenValue('columnText', json_encode($columnText));
$form->addHiddenValue('fieldDelimiter', urlencode($fieldDelimiter));
$form->addHiddenValue('stringEnclosure', urlencode($stringEnclosure));
$form->addHiddenValue('filename', $_POST['filename'] ?? '');
Expand Down

0 comments on commit ec95a1b

Please sign in to comment.