Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

When a post has a flag on it, moderators see this semi-transparent bar with details of the flag on it. One of the things the bar lists is "viewed by", listing all the mods who have seen the flag.

Now, the list of mods is a list of gravatars. In these, the URLs have HTML-encoded &s in the query string.

So, we get gravatars like, when we expect (Copt them to the address bar, I can't link them mere because the SE markdown editor automagically converts the entities to ampersands in the links).

Could this be fixed?

(Btw, for some reason, an HTML-encoded URL works with half the gravatars, like mine But that's a quirk on Gravatar's side. )

share|improve this question
@Matt: Double-encoded. And I'm sure this is a duplicate... – BoltClock's a Unicorn Dec 12 '12 at 11:35
up vote 8 down vote accepted

ASP.NET 4 added the (good) idea that when dynamically creating HTML, strings should be HTML-encoded by default (for security reasons), unless the developer explicitly says "I know what I'm doing; I have taken care of necessary encoding myself". The developer does this by passing an IHtmlString instead of a regular string.

With the change to ASP.NET 4.5 / MVC 4, the answer to "I know what I'm doing" is now "No you don't", at least in attributes.

There is an open issue on Codeplex for this, so this may be unintentional after all. I wouldn't count on it though, since it fits right in with other "improvements".

Anyway, we've added a workaround in the next build.

Regarding your "works with half the gravatars": If you look at your example, you have
    s = 24
    amp;d = identicon
    amp;r = PG

So the size parameter still works. The default parameter is broken, so you'd get the default instead of an identicon for users without an explicit gravatar. And the rating parameter is broken, thus falling back to the default G.

In other words, for users who have an actual gravatar that is not rated PG, this bug didn't make a difference (and this is probably true for most moderators).

share|improve this answer
Sweet, looks like Andrew Nurse is on the ASP.NET Razor team and has said it will be fixed (I can't deep link to the comment, but it's at the bottom). – Jarrod Dixon Dec 12 '12 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .