source/php/Parser/EventManagerApi.php
public function sanitizeCategories($categories): array
    {
        // Bail if not array
        if (!is_array($categories)) {
            return $categories;
        }

        return array_map(
            function ($category) {
                return ucfirst(trim(htmlspecialchars_decode($category)));
            },
            $categories
        );
    }
public function sanitizeCategories($categories): array
    {
        // Bail if not array
        if (!is_array($categories)) {
            return $categories;
        }

        return array_map(
            function ($category) {
                return ucfirst(trim(htmlspecialchars_decode($category)));
            },
            $categories
        );
    }
Sanitizes categories (capitalize, trim spaces, decode special chars)
@param array $categories List of categories
@return array