From d8fcb3cc709adc24296333870406efdb403a0551 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 24 Sep 2023 22:49:48 +0900 Subject: [PATCH] Add proper comments and some _rx_ variables to getDestroyXeVars() --- common/legacy.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/legacy.php b/common/legacy.php index b5015abc7..2f71ec994 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -762,9 +762,20 @@ function delObjectVars($target_obj, $del_obj): object return (object)$target_vars; } +/** + * Delete variables that are commonly submitted but don't need to be saved. + * + * @param array|object $vars + * @return array|object + */ function getDestroyXeVars($vars) { - foreach(array('error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id') as $var) + $delete_vars = array( + 'error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id', + '_filter', '_rx_ajax_compat', '_rx_ajax_form', '_rx_csrf_token', + ); + + foreach($delete_vars as $var) { if(is_array($vars)) {