347: url normalization looks broken in IE 7

tim****@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Jan. 10, 2008
What's the URL of the page containing the problem?

localhost/r/8//publish, e.g.

What steps will reproduce the problem?
1. create a new review request
2. publish it


What operating system are you using? What browser?

This is happening to folks running IE 7 on windows.


Please provide any additional information below.

This is the backtrace:

Page not found (404)
Request Method:
GET
Request URL:
http://localhost/r/8//publish/
Using the URLconf defined in reviewboard.urls, Django tried these URL
patterns, in this order:

1.  ^admin/
2.  ^api/json/
3.  ^r/ ^$
4.  ^r/ ^new/$
5.  ^r/ ^(?P<review_request_id>[0-9]+)/$
6.  ^r/ ^(?P<review_request_id>[0-9]+)/diff/$
7.  ^r/ ^(?P<review_request_id>[0-9]+)/diff/(?P<revision>[0-9]+)/$
8.  ^r/ ^(?P<review_request_id>[0-9]+)/diff/raw/$
9.  ^r/ ^(?P<review_request_id>[0-9]+)/diff/(?P<revision>[0-9]+)/raw/$
10.             ^r/
^(?P<review_request_id>[0-9]+)/diff/(?P<revision>[0-9]+)/fragment/(?P<filediff_id>[0-9]+)/$
11.             ^r/
^(?P<review_request_id>[0-9]+)/diff/(?P<revision>[0-9]+)/fragment/(?P<filediff_id>[0-9]+)/chunk/(?P<chunkindex>[0-9]+)/$
12.             ^r/
^(?P<review_request_id>[0-9]+)/diff/(?P<revision>[0-9]+)-(?P<interdiff_revision>[0-9]+)/$
13.             ^r/ ^(?P<review_request_id>[0-9]+)/publish/$
14.             ^r/
^(?P<review_request_id>[0-9]+)/(?P<action>(discard|submitted|reopen))/$
15.             ^r/
^(?P<review_request_id>[0-9]+)/s/(?P<screenshot_id>[0-9]+)/$
16.             ^r/
^(?P<review_request_id>[0-9]+)/s/(?P<screenshot_id>[0-9]+)/delete/$
17.             ^r/ ^(?P<review_request_id>[0-9]+)/preview-email/$
18.             ^r/
^(?P<review_request_id>[0-9]+)/reviews/(?P<review_id>[0-9]+)/preview-email/$
19.             ^r/
^(?P<review_request_id>[0-9]+)/reviews/(?P<review_id>[0-9]+)/replies/(?P<reply_id>[0-9]+)/preview-email/$
20.             ^r/ ^search/$
21.             ^reports/
22.             ^$
23.             ^dashboard/$
24.             ^users/$
25.             ^users/(?P<username>[A-Za-z0-9_\-\.]+)/$
26.             ^groups/$
27.             ^groups/(?P<name>[A-Za-z0-9_-]+)/$
28.             ^feeds/rss/(?P<url>.*)/$
29.             ^feeds/atom/(?P<url>.*)/$
30.             ^account/login/$
31.             ^account/logout/$
32.             ^account/preferences/$
33.             ^iphone/
34.             ^account/register/$
35.             ^css/(?P<path>.*)$
36.             ^images/(?P<path>.*)$
37.             ^scripts/(?P<path>.*)$
The current URL, r/8//publish/, didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a standard 404
page.
#1 cuv****@gmai***** (Google Code) (Is this you? Claim this profile.)
I found this on IE6 as well.  It works ok with an apache server, but with the Django
development server it fails.  It always works in Firefox as well, so I would guess
that Firefox and Apache are nice enough to normalize the URL automatically.

The problem seems that IE doesn't support array-subscripts on strings correctly, so
RB's normalizeURL() doesn't work right.  This small patch makes it work for me:

--- a/htdocs/scripts/reviews.js
+++ b/htdocs/scripts/reviews.js
@@ -24,7 +24,7 @@ function normalizeURL(url) {
         url = url.substring(0, i);
     }

-    if (url[url.length - 1] == "/") {
+    if (url.charAt(url.length - 1) == "/") {
         url = url.substring(0, url.length - 1);
     }
chipx86
#2 chipx86
Fixed in r1110.
  • +Fixed
  • -Priority-Medium
    +Priority-High
    +Component-Reviews
    +Browser
  • +chipx86