Recursively filter slashes in array

@param mixed $value
@return array
187766
public function filter($value)
    {
        return is_array($value) ? array_map(array($this, __FUNCTION__), $value) : stripslashes($value);
    }
752111
public static function parseShortcut($value)
    {
        if (strpos($value, ',') === false) {
            $col = "1";
            $filter = $value;
        } else {
            list($col, $filter) = explode(',', $value, 2);
            $col = trim($col);
        }
        $filter = trim($filter);

        return array(
            'column'=>$col,
            'filter'=>$filter,
            'params'=>array()
        );
    }
431829
public function filter($value)
    {
        if ($value === null) {
            return $value;
        }

        if ($this->characters === null) {
            return trim($value);
        }

        return trim($value, $this->characters);
    }
314451
protected function cleanValue($value)
	{
		if (is_array($value)) {
			return array_map(function ($v) {
				return $this->cleanValue($v);
			}, $value);
		} else {
			return stripslashes($value);
		}
	}
178396
public function filter($value)
    {
        if (is_int($value)) {
            return (string) $value;
        }
        if (! (is_float($value) || is_string($value))) {
            return $value;
        }
        $value = (string) $value;

        if (!StringUtils::hasPcreUnicodeSupport()) {
            // POSIX named classes are not supported, use alternative 0-9 match
            $pattern = '/[^0-9]/';
        } elseif (extension_loaded('mbstring')) {
            // Filter for the value with mbstring
            $pattern = '/[^[:digit:]]/';
        } else {
            // Filter for the value without mbstring
            $pattern = '/[\p{^N}]/';
        }

        return preg_replace($pattern, '', $value);
    }
19940
public function filter($value)
    {
        if (is_object($value) && ! method_exists($value, '__toString')) {
            return '';
        }

        if (is_array($value)) {
            $dummy = [
                'name' => '',
                'tmp_name' => '',
                'error' => UPLOAD_ERR_NO_FILE,
                'size' => 0,
                'type' => '',
            ];
            $value = ArrayUtils::merge($dummy, $value);
        } else {
            $value = (string) $value;
        }

        if (isset($value['error']) && $value['error'] !== UPLOAD_ERR_OK) {
            return '';
        }

        if ($this->options['use_uploaded_name'] && isset($value['name'])) {
            $value = $value['name'];
        } elseif (isset($value['tmp_name'])) {
            $value = $value['tmp_name'];
        }

        if ($this->options['basename']) {
            $value = basename($value);
        }

        return $value;
    }
108299
public static function realUrl(string $value)
    {
        list($scheme, $url) = explode('//', $value);
        $reverse = explode('/', $url);
        $arr = [];
        foreach ($reverse as $item) {
            $arr[] = $item;
            if ($item == '..') {
                array_pop($arr);    // remove 2x from array stack
                array_pop($arr);
            }
        }
        return $scheme . '//' . implode('/', $arr);
    }
877746
protected function parseAddresses($value)
    {
        return collect($value)->map(function ($address, $name) {
            return [$address, is_numeric($name) ? null : $name];
        })->values()->all();
    }
1273965
public function filter($value)
    {
        if (!is_scalar($value)) {
            return $value;
        }
        $value = (string) $value;

        $defaultScheme = $this->defaultScheme ?: $this->enforcedScheme;

        // Reset default scheme if it is not a known scheme
        if (!UriFactory::getRegisteredSchemeClass($defaultScheme)) {
            $defaultScheme = null;
        }

        try {
            $uri = UriFactory::factory($value, $defaultScheme);
            if ($this->enforcedScheme && (!$uri->getScheme())) {
                $this->enforceScheme($uri);
            }
        } catch (UriException $ex) {
            // We are unable to parse / enfore scheme with the given config and input
            return $value;
        }

        $uri->normalize();

        if (!$uri->isValid()) {
            return $value;
        }

        return $uri->toString();
    }
979538
public function filter(&$value) {
        $accepted_types = optional_param_array('accepted_types', '', PARAM_RAW);
        if (isset($value['children'])) {
            if (!empty($value['children'])) {
                $value['children'] = array_filter($value['children'], array($this, 'filter'));
            }
            return true; // always return directories
        } else {
            if ($accepted_types == '*' or empty($accepted_types)
                or (is_array($accepted_types) and in_array('*', $accepted_types))) {
                return true;
            } else {
                foreach ($accepted_types as $ext) {
                    if (preg_match('#'.$ext.'$#i', $value['title'])) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
651521
public static function stripslashesDeep($value)
    {
        $value = is_array($value) ?
                    array_map(array('StringUtils', 'stripslashesDeep'), $value) :
                    stripslashes($value);

        return $value;
    }
801077
public function filter($value)
    {
        if (!$value instanceof User) {
            return array();
        }

        $info = $value->getInfo();

        return array(
            'id' => $value->getId(),
            'name' => $info->displayName,
            'image' => $info->image ? $info->image->uri : '',
            'email' => $info->email,
        );
    }
137706
public function filter($value)
    {
        // perform some transformation upon $value to arrive on $valueFiltered
        $valueFiltered = strtoupper(trim($value));
        if (strlen($valueFiltered) == 6) {
            if (preg_match('/\d{4,4}[A-Z]{2,2}/', $valueFiltered)) {
                $valueFiltered = substr_replace($valueFiltered, ' ', 4, 0);
            }
        }

        return $valueFiltered;
    }
306022
protected function inArray($value)
    {
        if ($this->strict) {
            $isIn = in_array($value, $this->range, true);
        } else {
            $isIn = false;
            foreach ($this->range as $r) {
                $isIn = (strcmp($r, $value) === 0);
                if ($isIn) break;
            }
        }
        return $isIn;
    }
407307
public function filter($value)
    {
        $chars = ' ';
        if ($this->getExtras()) {
            $chars .= $this->getExtras();
        }
        return trim($value, $chars);
    }
916989
public function filter($value)
    {
        if (!is_string($value) && !is_array($value)) {
            return $value;
        }
        return str_replace($this->search, $this->replacement, $value);
    }
1177465
public function sanitize_repeater_setting( $value ) {
		if ( ! is_array( $value ) ) {
			$value = json_decode( urldecode( $value ) );
		}
		if ( empty( $value ) || ! is_array( $value ) ) {
			$value = [];
		}

		// Make sure that every row is an array, not an object.
		foreach ( $value as $key => $val ) {
			$value[ $key ] = (array) $val;
			if ( empty( $val ) ) {
				unset( $value[ $key ] );
			}
		}

		// Reindex array.
		if ( is_array( $value ) ) {
			$value = array_values( $value );
		}

		return $value;
	}