Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sanitize_key( $key ) {
- $filter = array( 'pass', 'password', 'jelszo' );
- if( ! is_string( $key ) ) {
- return true;
- }
- return ! in_array( $key, $filter );
- }
- function sanitize_array( &$array, $depth = 10 ) {
- $array = unserialize( serialize( $in_array ) );
- if( $depth <= 0 ) {
- return array();
- }
- if( is_array( $array ) ) {
- foreach( $array as $k => $v ) {
- if( sanitize_key( $k ) ) {
- $array[$k] = sanitize_array( $v );
- } else {
- $array[$k] = "****";
- }
- }
- }
- return $array;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement