form posted to new window when domain truncated

RESOLVED WORKSFORME

Status

()

Core
HTML: Form Submission
RESOLVED WORKSFORME
17 years ago
3 years ago

People

(Reporter: srini, Assigned: Eric Pollmann)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
BuildID:    Mozilla/5.0 (Windows; U; WinNT4.0; en-US; m18) Gecko/20010131

When a form in a page has target an iframe and document domain is truncated 
iframe lauched in new window when form is submited.  Problem can be reproduced 
on tomcat and iis webservers but not on apache where it works allright

Reproducible: Always
Steps to Reproduce:
create
file 1 
<HTML>
<HEAD>
    <SCRIPT>
            var lsOrigin = document.domain;
            var liFirstDot = lsOrigin.indexOf( "." );
            document.domain = lsOrigin.substring( liFirstDot + 1 );
            document.write( document.domain ); 
    </SCRIPT>
</HEAD>
<BODY>
    
     <FORM target="frm1" method="post" action="http://www.mozilla.org">
     <input type="submit" value="submit">
     </FORM>
    <IFRAME name="frm1" width="100%" height="200" 
src="http://myserver.com/myfile2.html"></IFRAME>
    </P>
</BODY>
</HTML>
Change source of iframe (http://myserver.com/myfile2.html) to location of file2 
on your server

file 2

<HTML>
<HEAD>
    <script>
            var lsOrigin = document.domain;
            var liFirstDot = lsOrigin.indexOf( "." );
            document.domain = lsOrigin.substring( liFirstDot + 1 );
    </script>
</HEAD>
<BODY>
    <SCRIPT>
        document.write( document.domain + "<BR>" );
    </SCRIPT>
</BODY>
</HTML>



Actual Results:  In tomcat and iis webserver (on NT) form submitted in new 
window and in apache form submitted to iframe in same window

Expected Results:  form should be submitted in the same window

The idea is to look if page is scriptable and when not open a new window (after 
origin check)

Comment 1

17 years ago
*** Bug 68815 has been marked as a duplicate of this bug. ***

Comment 2

17 years ago
*** Bug 68816 has been marked as a duplicate of this bug. ***

Comment 3

17 years ago
reassigning
Assignee: rods → pollmann
changing component
Component: HTML Form Controls → Form Submission

Updated

17 years ago
Keywords: qawanted
(Reporter)

Comment 5

17 years ago
I am changing the status of this bug to blocker as this is a showstopper for us.
Severity: major → blocker
(Assignee)

Comment 6

17 years ago
I can not reproduce this problem.  Reporter, can you post a public URL that we
can reproduce this at?  (Set up your testcase on an Apache server and it worked
as it should, but this is as you describe)
(Assignee)

Comment 7

17 years ago
FWIW, an apache server with this testcase working is here:
http://302easyst.net/~pollmann/bugs/spoof/8/index.html

Comment 8

17 years ago
WORKSFORME
Platform: PC
OS: Windows 98
Mozilla Build: 2001032804


Marking as such.
Severity: blocker → normal
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → WORKSFORME
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.