public static function intersectAllowedFilters(array $filters, array $allowed)
	{
		foreach ($filters as $filter => $value) {
			// We want to recursively go down and check all OR conjuctions to ensure they're all whitlisted
			if ($filter === 'or') {
				$filters['or'] = self::intersectAllowedFilters($filters['or'], $allowed);

				// If there are no more filters under this OR, we can safely unset it
				if (count($filters['or']) === 0) {
					unset($filters['or']);
				}
				continue;
			}

			// We want to recursively go down and check all AND conjuctions to ensure they're all whitlisted
			if ($filter === 'and') {
				$filters['and'] = self::intersectAllowedFilters($filters['and'], $allowed);

				// If there are no more filters under this AND, we can safely unset it
				if (count($filters['and']) === 0) {
					unset($filters['and']);
				}
				continue;
			}

			// A whitelisted filter looks like 'filter_name' => true in $allowed
			if (! isset($allowed[$filter]) || ! $allowed[$filter]) {
				unset($filters[$filter]);
			}
		}

		return $filters;
	}