#11262 closed defect (fixed)
MSIE10 bug: "#__msie303:" not being replaced to "#" on client side
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | ticket system | Version: | 1.0.1 |
Severity: | minor | Keywords: | iexplorer, iexplorer10, navigation, javascript, msie303 |
Cc: | Branch: | ||
Release Notes: |
Fix |
||
API Changes: | |||
Internal Changes: |
Description
Found a bug in our local 1.0.1 installation.
Using Windows 7 SP1 x64 and freshly installed MSIE10 with all default settings.
When making changes to existing ticket or just adding a comment, the resulting URL is something like http://trac.***.ru/ticket/39746#__msie303:comment:14
IE9 is OK, but in IE10 it's always "#__msie303": in the URL anchor.
I checked the source code within the browser, the replacement js code is alright, but the address stays wrong. I checked IE10 development console, there are no javascript fatal errors.
Finally, I tried to create a new ticket on Edgewall's 1.0.1 sandbox and then post a comment into it with my MSIE10. I got exactly the same broblem and the wrong url: http://trac.edgewall.org/demo-1.0/ticket/2121#__msie303:comment:1
I asked my colleague with MSIE10 (unfortunatelly, I cannon ask him about his exact environment) to check for this problem at our installation, he has the same problems.
Before I installed MSIE10, there was no such problem with MSIE9 on my machine.
Attachments (0)
Change History (9)
comment:1 by , 11 years ago
Component: | web frontend → ticket system |
---|---|
Milestone: | → 1.0.2 |
comment:2 by , 11 years ago
Reproduced. The hash #__msie303:...
is workaround for #10382 and #10590 introduced by [10851] and [11016]. According to comment:8:ticket:10382, the issue was present in IE 7/8/9.
I just confirmed the #10382 with IE 6-10.
IE6 | reproduced |
IE7 | reproduced |
IE8 | not reproduced |
IE9 | not reproduced |
IE10 | not reproduced |
At least, for IE10, the workaround is not needed.
-
trac/web/api.py
index 05e80d1..b82a70f 100644
a b from hashlib import md5 23 23 import new 24 24 import mimetypes 25 25 import os 26 import re 26 27 import socket 27 28 from StringIO import StringIO 28 29 import sys … … class Request(object): 479 480 scheme, host = urlparse.urlparse(self.base_url)[:2] 480 481 url = urlparse.urlunparse((scheme, host, url, None, None, None)) 481 482 482 # Workaround #10382, IE6+ bug when post and redirect with hash 483 if status == 303 and '#' in url and \ 484 ' MSIE ' in self.environ.get('HTTP_USER_AGENT', ''): 485 url = url.replace('#', '#__msie303:') 483 # Workaround #10382, IE6-IE9 bug when post and redirect with hash 484 if status == 303 and '#' in url: 485 match = re.search(' MSIE ([0-9]+)', 486 self.environ.get('HTTP_USER_AGENT', '')) 487 if match and int(match.group(1)) < 10: 488 url = url.replace('#', '#__msie303:') 486 489 487 490 self.send_header('Location', url) 488 491 self.send_header('Content-Type', 'text/plain')
comment:3 by , 11 years ago
AFAIR, MSIE lies about its version when working in Compatibility Mode. It might be more accurate to check for Trident version, shall the issue be compatibility-independent.
comment:5 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
I investigated with each version of Internet Explorer again.
#10382 | #__msie303 workaround | User-Agent | |
IE 10 (strict mode) | not reproduced | not working | Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
|
IE 10 (compat mode) | not reproduced | ok | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)
|
IE 9 (strict mode) | not reproduced | ok | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
|
IE 9 (compat mode) | not reproduced | ok | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0)
|
IE 8 (strict mode) | not reproduced | ok | Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
|
IE 8 (compat mode) | not reproduced | ok | Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
|
Therefore, I think that the patch in comment:2 is sufficient to solve this issue. I'll apply it to 0.12-stable, 1.0-stable and trunk later.
comment:6 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Thanks for the reporting! Fixed in [11949] for 0.12-stable and merged in [11950-11951].
comment:8 by , 11 years ago
BTW, I thought you will eventually change the checking from MSIE string to Trident.
I personally used the following code based on your:
-
Internal/Utilities/trac/branches/TR1.0.1/trac/web/api.py
a b 474 474 475 475 # Workaround #10382, IE6+ bug when post and redirect with hash 476 # manually patched until 1.0.2 - REMOVE LATER 477 import re 478 # 476 479 if status == 303 and '#' in url and \ 480 re.search('Trident ([0-9]+)',self.environ.get('HTTP_USER_AGENT', '')) and \ 481 int(re.search('Trident ([0-9]+)',self.environ.get('HTTP_USER_AGENT', '')).group(1)) < 6 and \ 477 482 ' MSIE ' in self.environ.get('HTTP_USER_AGENT', ''): 478 483 url = url.replace('#', '#__msie303:')
Although MSIE would be okay as well, shall the bug appears only in Strict Mode (MSIE version in User Agent should be 10 in Strict Mode, AFAIK).
I can confirm the behavior in IE10 on Windows 7. I haven't looked into the source of the problem, but I think we should fix this for 1.0.2.