Filter the input component.

@throws SyntaxError If the component can not be converted to a string or null
199744
protected static function filterComponent($component): ?string
    {
        if ($component instanceof UriComponentInterface) {
            return $component->getContent();
        }

        if (null === $component) {
            return $component;
        }

        if (!is_scalar($component) && !method_exists($component, '__toString')) {
            throw new TypeError(sprintf('Expected component to be stringable; received %s', gettype($component)));
        }

        $component = (string) $component;
        if (1 !== preg_match(self::REGEXP_INVALID_URI_CHARS, $component)) {
            return $component;
        }

        throw new SyntaxError(sprintf('Invalid component string: %s', $component));
    }
73945
protected function filter()
	{
		foreach ($this->filters as $attribute => $filters) {
			// Check if the attribute is present in the input data
			if (!array_key_exists($attribute, $this->data)) {
				continue;
			}

			$data = $this->data[$attribute];

			foreach ($filters as $filter) {
				// The format for specifying filter and parameters follows an
				// easy {filter}:{parameters} formatting convention.
				if (strpos($filter, ':') !== false) {
					list($filter, $parameterList) = explode(':', $filter, 2);
					$parameters = explode(',', $parameterList);
				} else {
					$parameters = [];
				}
				
				if (method_exists($this, $this->camelCase($filter))) {
					$data = $this->filterWalker($filter, $data, $parameters);
				} elseif (isset($this->extensions[$filter])) {
					$data = $this->filterExtensionWalker($filter, $data, $parameters);
				} else {
					throw new \Exception("'$filter' is not a valid filter.");
				}
			}

			$this->filteredData[$attribute] = $data;
		}

		return $this->filteredData;
	}
799070
function(input) {
			var self = this;
			if (!self.settings.create) return false;
			var filter = self.settings.createFilter;
			return input.length
				&& (typeof filter !== 'function' || filter.apply(self, [input]))
				&& (typeof filter !== 'string' || new RegExp(filter).test(input))
				&& (!(filter instanceof RegExp) || filter.test(input));
		}
48432
function filterOptions(options, value)
{
	// If the input value is `undefined` or empty.
	if (!value) {
		return options
	}

	value = value.toLowerCase()

	return options.filter(({ label }) => label.toLowerCase().indexOf(value) >= 0)
}
361252
function onParsingComplete ()
  {
    // Validate defaultParam's value.
    $def = isset($this->props->defaultParam) ? $this->props->defaultParam : null;
    if (!empty($def)) {
      if (!$this->props->defines ($def))
        throw new ComponentException($this,
          "Invalid value for <kbd>defaultParam</kbd> on <b>&lt;{$this->getTagName()}></b>; parameter <kbd>$def</kbd> does not exist");

      // Move children to default parameter.
      if ($this->hasChildren ()) {
        $type = $this->props->getTypeOf ($def);
        if ($type != type::content && $type != type::metadata)
          throw new ComponentException($this, sprintf (
            "The macro's default parameter <kbd>$def</kbd> can't hold content because its type is <kbd>%s</kbd>.",
            type::getNameOf ($type)));

        $param = new Metadata($this->context, ucfirst ($def), $type);
        $this->props->set ($def, $param);
        $param->attachTo ($this);
        $param->setChildren ($this->getChildren ());
      }
    }
    elseif ($this->hasChildren ())
      throw new ComponentException ($this,
        'You may not specify content for this tag because it has no default property');
  }
1339991
private function validateDocument(): void
    {
        if (!$this->is_binary_data) {
            return;
        }

        $res = base64_decode($this->document, true);
        if (false === $res || $this->document !== base64_encode($res)) {
            throw new SyntaxError(sprintf('invalid document, `%s`', $this->document));
        }
    }
472426
@Override
    public String filter(String value, String previousValue){
        if(previousValue != null && value.length() > previousValue.length())
            return value;
        return value.equals("0") || value.equals("0.0") ? "" : value;
    }
521225
public boolean filter(Event event) {
        LOG.info("StringContentFilter called");
        
        if (wordsToFilter != null) {
            for (String filterWord : wordsToFilter) {
                if (event.getContent() != null
                        && -1 != event.getContent().indexOf(filterWord)) {
                    return true;
                }
            }
        }
        return false;
    }
1109750
void filterTree(String filter) {

        HierarchicalContainer container = (HierarchicalContainer)m_tree.getContainerDataSource();
        container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            final String lowerCaseFilter = filter.toLowerCase();
            container.addContainerFilter(new Filter() {

                private static final long serialVersionUID = 1L;

                public boolean appliesToProperty(Object propertyId) {

                    return true;
                }

                public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {

                    CmsCategory cat = (CmsCategory)itemId;

                    return cat.getPath().toLowerCase().contains(lowerCaseFilter)
                        || ((cat.getTitle() != null) && cat.getTitle().toLowerCase().contains(lowerCaseFilter));
                }
            });
        }
    }
189593
def strip_filter(value):
    '''
    

    '''
    if isinstance(value, basestring):
        value = bleach.clean(value, tags=ALLOWED_TAGS,
                             attributes=ALLOWED_ATTRIBUTES, 
                             styles=ALLOWED_STYLES, strip=True)
    return value
763928
function iterateFilter(input) {
  var self = this,
    out = {};

  if (utils.isArray(input)) {
    return utils.map(input, function (value) {
      return self.apply(null, arguments);
    });
  }

  if (typeof input === 'object') {
    utils.each(input, function (value, key) {
      out[key] = self.apply(null, arguments);
    });
    return out;
  }

  return;
}
267970
public function filteredInput()
    {
        $files = $this->arrayFilterRecursive(Request::file());
        $input = array_replace_recursive(Request::input(), $files);

        return Library\Utils\Collection::nullEmpties($input);
    }
492704
@Override
    public void processComponent(String propertyName, JComponent component) {

        if (component instanceof JComboBox) {
            this.installSearchable((JComboBox) component);
        } else if (component instanceof JList) {
            this.installSearchable((JList) component);
        } else if (component instanceof JTable) {
            this.installSearchable((JTable) component);
        } else if (component instanceof JTextComponent) {
            this.installSearchable((JTextComponent) component);
        }
    }
1202506
function filterFunc(inputValue, optionValue) {
  if (inputValue && optionValue) {
    return optionValue.toLowerCase().indexOf(inputValue.toLowerCase()) > -1;
  }

  return false;
}
357850
protected
  void parseFilters(Element element, Appender appender) {
    String clazz = subst(element.getAttribute(CLASS_ATTR));
    Filter filter = (Filter) OptionConverter.instantiateByClassName(clazz,
                                                Filter.class, null);
    
    if(filter != null) {
      PropertySetter propSetter = new PropertySetter(filter);
      NodeList children = element.getChildNodes();
      final int length 	= children.getLength();

      for (int loop = 0; loop < length; loop++) {
	Node currentNode = children.item(loop);
	if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
	  Element currentElement = (Element) currentNode;
	  String tagName = currentElement.getTagName();
	  if(tagName.equals(PARAM_TAG)) {
            setParameter(currentElement, propSetter);
	  } else {
            quietParseUnrecognizedElement(filter, currentElement, props);
      }
	}
      }
      propSetter.activate();
      LogLog.debug("Adding filter of type ["+filter.getClass()
		   +"] to appender named ["+appender.getName()+"].");
      appender.addFilter(filter);
    }    
  }
854860
public static String filterHtmlElementName(SoyValue value) {
    value = normalizeNull(value);
    return filterHtmlElementName(value.coerceToString());
  }
15260
public function filter($value) {
    	    	
    	$value   = str_replace(["\r", "\r\n", "\n"], '', $value);
    	$decoded = json_decode($value,true);
    	if(is_null($decoded)){
    		return null;
    	}    	
    	
    	switch($this->options["format"]){
    	    case self::DECODED:
    	        return $decoded;
    	    case self::JSON:
    	        return $value;
    	    case self::SERIALIZED:
    	        return serialize($decoded);
    	    default:
    	        throw new FilterException("unknown format for JSON filter specified");
    	}
    }