all(); /** @var callable|null */ $cleanInput = null; $cleanInput = function (&$input, $name, $rootName = null) use ($params, &$cleanInput) { // * Nested element array if (is_array($input)) { array_walk_recursive($input, $cleanInput, $name); } if (!is_string($input)) { return; } if (in_array($name, $params) or in_array($rootName ?? $name, $params)) { // ? Is a json input ? if ($isJson = \json_decode($input, true) and is_array($isJson)) { // ! Decode each json field recursive. \array_walk_recursive($isJson, function (&$item) { if (\is_string($item)) { $item = clean($item); $item = ToolboxHelper::stripCkEditorSchemesOnMediaInputs($item); } }); } else { $input = clean($input); $input = ToolboxHelper::stripCkEditorSchemesOnMediaInputs($input); } } else { $input = strip_tags($input); } }; \array_walk($inputs, $cleanInput); $request->merge($inputs); return $next($request); } }