What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 128 Stack Exchange communities.

On one's own User Page (tested on StackOverflow site), on favorites tab: http://stackoverflow.com/users/46058?tab=favorites, the links which should select sort order, i.e. "added", "recent", "views", "newest", "votes" links are double HTML encoded, containing & in place of & (or even better ;).

For example link is:

  • http://stackoverflow.com/api/userfavorites.html?page=1&pagesize=15&userid=46058&sort=recent

and should be

  • http://stackoverflow.com/api/userfavorites.html?page=1&pagesize=15&userid=46058&sort=recent

This does not matter if you just click on link, as SO would then use Ajax to update page, landing on

  • http://stackoverflow.com/users/46058?tab=favorites#fpage_1-fsort_recent

But it does matter when I use 'Ctrl-Click' or 'Open in new tab' to open in new tab (landing on "Page Not Found"). You can also see this incorrect URL on mouseover (on hover) in the status bar area.

When I edit link to the second version it works correctly.


The stats tab doesn't have this bug.

share|improve this question
    
Stats tab may not double-encode, but it still has issues when doing Open in New Tab. –  Grace Note Nov 16 '10 at 20:23
add comment

1 Answer 1

HTML 4.01 strict requires ampersand to be encoded.

https://developer.mozilla.org/en/Fixing_common_validation_problems#Ampersands

Because the ampersand character (&) is reserved for marking character entities, authors should never use raw ampersands in their HTML source-- and that includes ampersands inside URLs! Thus, any URL that needs an ampersand should be written like this:

http://www.site.web/path/doc.html?var1=val1&var2=val2&var3=val3

share|improve this answer
1  
But they're double encoded as & on that page, which is the issue. –  Tim Stone Nov 18 '10 at 7:01
    
@tim ah, that would be bad then. Sorry, I wasn't getting that part.. –  Jeff Atwood Nov 18 '10 at 7:24
add comment

You must log in to answer this question.

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