BF2Statistics.Gamespy.MasterClient.FixFilter C# (CSharp) Method

FixFilter() private method

private FixFilter ( string filter ) : string
filter string
return string
        private string FixFilter(string filter)
        {
            // escape [
            filter = filter.Replace("[", "[[]");
            try
            {
                // fix an issue in the BF2 main menu where filter expressions aren't joined properly
                // i.e. "numplayers > 0gametype like '%gpm_cq%'"
                // becomes "numplayers > 0 && gametype like '%gpm_cq%'"
                filter = FixFilterOperators(filter);

                // fix quotes inside quotes
                // i.e. hostname like 'flyin' high'
                // becomes hostname like 'flyin_ high'
                filter = FixFilterQuotes(filter);
            }
            catch (Exception)
            {
                //LogError(Category, e.ToString());
            }

            // fix consecutive whitespace
            return Regex.Replace(filter, @"\s+", " ").Trim();
        }