From 8b1eeda28f71457a5199c0fce2ba34e911553fb2 Mon Sep 17 00:00:00 2001 From: Charles Severance Date: Tue, 17 May 2022 12:24:18 -0400 Subject: [PATCH] Improve _sha256 field handling --- src/Core/LTIX.php | 3 ++- src/UI/CrudForm.php | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Core/LTIX.php b/src/Core/LTIX.php index 637b44f2..fac951a1 100644 --- a/src/Core/LTIX.php +++ b/src/Core/LTIX.php @@ -1,5 +1,6 @@ xyz_sha256 + // xyz_key => xyz_sha256 if ( strpos($field, "_sha256") !== false && ! isset($_POST[$field])) { $key = str_replace("_sha256", "_key", $field); + $key2 = str_replace("_sha256", "", $field); // Allow nulls - if ( ! array_key_exists($key, $_POST) ) continue; + if ( array_key_exists($key, $_POST)) { + // All good + } else if ( array_key_exists($key2, $_POST)) { + $key = $key2; + } else { + continue; + } + if ( $_POST[$key] === null ) { $value = null; } else {