Edgewall Software

Opened 11 years ago

Closed 11 years ago

Last modified 9 years ago

#11262 closed defect (fixed)

MSIE10 bug: "#__msie303:" not being replaced to "#" on client side — at Version 6

Reported by: lp-san@… 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 #__msie303 workaround not working on Internet Explorer 10 in strict mode.

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.

Change History (6)

comment:1 by Ryan J Ollos, 11 years ago

Component: web frontendticket system
Milestone: 1.0.2

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.

comment:2 by Jun Omae, 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  
    2323import new
    2424import mimetypes
    2525import os
     26import re
    2627import socket
    2728from StringIO import StringIO
    2829import sys
    class Request(object):  
    479480            scheme, host = urlparse.urlparse(self.base_url)[:2]
    480481            url = urlparse.urlunparse((scheme, host, url, None, None, None))
    481482
    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:')
    486489
    487490        self.send_header('Location', url)
    488491        self.send_header('Content-Type', 'text/plain')
Last edited 11 years ago by Jun Omae (previous) (diff)

comment:3 by anonymous, 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:4 by Jun Omae, 11 years ago

Indeed. Thanks for the information!

comment:5 by Jun Omae, 11 years ago

Owner: set to Jun Omae
Status: newassigned

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 Jun Omae, 11 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks for the reporting! Fixed in [11949] for 0.12-stable and merged in [11950-11951].

Note: See TracTickets for help on using tickets.