Changes between Initial Version and Version 1 of Ticket #23416, comment 9
- Timestamp:
- 11/22/2014 04:24:11 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23416, comment 9
initial v1 1 1 What about a function like this which allows you to sanitise an array recursively and to apply filters to each of the keys to strip_tags or whatever? 2 2 Whether its an array or a value it just iterate and recurse allowing you to create filter for all the values in an array like for authors[] or the key author just hooking "filter_array_authors" or "filter_array_author" 3 3 and you can call it with 4 {{{ $_POST = recur_filter($_POST); }}} 4 5 {{{ 5 function recur_ trim($vars, $pkey = null) {6 function recur_filter($vars, $pkey = null) { 6 7 $filter = "filter_array"; 7 8 … … 24 25 $arg = $pkey; 25 26 } 26 $vars[$key] = recur_ trim($vars[$key], $arg);27 $vars[$key] = recur_filter($vars[$key], $arg); 27 28 } 28 29 else {