• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/rest/internalizer.php
  • Класс: BitrixDiskRestInternalizer
  • Вызов: Internalizer::cleanFilter
public function cleanFilter(array $filter)
{
	$possibleFields = $this->entity->getFieldsForFilter();
	$mapFields = $this->entity->getFieldsForMap();
	$whiteFilter = array();

	$filter = array_change_key_case($filter, CASE_UPPER);
	foreach($filter as $key => $value)
	{
		if(is_numeric($key) && is_array($value))
		{
			continue;
		}
		if(preg_match('/^([^a-zA-Z]*)(.*)/', $key, $matches))
		{
			$operation = $matches[1];
			$field = $matches[2];

			if(!in_array($operation, $this->allowedOperations, true))
			{
				continue;
			}
			if(isset($possibleFields[$field]))
			{
				if(isset($mapFields[$field]))
				{
					$value = call_user_func_array($mapFields[$field]['IN'], array($value));
				}
				$whiteFilter[$key] = $value;
			}
		}
	}

	return $whiteFilter;
}