Small change request for the core

Jan 3, 2009 at 2:48 AM
In looking at reaching XHTML 1.1 compliance, I found a small change that will help not only for compliance but for SEO as well.  All that is required is a HttpUtility.HtmlEncode(category) as found in the following snippet:

[code]
        protected virtual string CategoryLinks(string separator)
        {
            string[] keywords = new string[Post.Categories.Count];
            string link = "<a href=\"{0}{1}.aspx\">{2}</a>";
            string path = VirtualPathUtility.ToAbsolute("~/category/");
            for (int i = 0; i < Post.Categories.Count; i++)
            {
                if (Category.Categories.Contains((Category)Post.Categories[i]))
                {
                    string category = Category.GetCategory(Post.Categories[i].Id).Title;
                    keywords[i] = string.Format(CultureInfo.InvariantCulture, link, path, Utils.RemoveIllegalCharacters(category), HttpUtility.HtmlEncode(category));
                }
            }


            return string.Join(separator, keywords);
        }

[/code]

Yeah, I had an & in my category name...hope you agree and include it in the next release.  I didn't know where else to put this...

Cheers!

Wayne