Back to InputFilter class

Method stripUSC

protected mixed
stripUSC
(mixed $source)
Recursively strip Unicode Supplementary Characters from the source. Not: objects cannot be filtered.
Parameters
  • mixed $source The data to filter
Returns
  • mixed The filtered result
Since
  • 3.5
Class: InputFilter
Project: Joomla

Method stripUSC - Source code

/**
 * Recursively strip Unicode Supplementary Characters from the source. Not: objects cannot be filtered.
 *
 * @param   mixed  $source  The data to filter
 *
 * @return  mixed  The filtered result
 *
 * @since  3.5
 */
protected function stripUSC($source)
{
    if (\is_object($source)) {
        return $source;
    }
    if (\is_array($source)) {
        $filteredArray = array();
        foreach ($source as $k => $v) {
            $filteredArray[$k] = $this->stripUSC($v);
        }
        return $filteredArray;
    }
    return preg_replace('/[\\xF0-\\xF7].../s', "⯑", $source);
}