Skip to content
Snippets Groups Projects
Commit fee5bf75 authored by Olav Morken's avatar Olav Morken
Browse files

Fix "post-redirect" not working when one of the parameters is named "submit".

It appears that there is some special processing of elements named "submit"
when triggering form-submit through javascript. This patch adds a workaround
for that.

Thanks to Christian Gijtenbeek for finding and fixing this bug!

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3024 44740490-163a-0410-bde0-09ae8108e29a
parent 1fd61240
No related branches found
No related tags found
No related merge requests found
...@@ -5,13 +5,17 @@ ...@@ -5,13 +5,17 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>POST data</title> <title>POST data</title>
</head> </head>
<body onload="document.forms[0].submit()"> <body onload="document.getElementsByTagName('input')[0].click();">
<noscript> <noscript>
<p><strong>Note:</strong> Since your browser does not support JavaScript, you must press the button below once to proceed.</p> <p><strong>Note:</strong> Since your browser does not support JavaScript, you must press the button below once to proceed.</p>
</noscript> </noscript>
<form method="post" action="<?php echo htmlspecialchars($this->data['destination']); ?>"> <form method="post" action="<?php echo htmlspecialchars($this->data['destination']); ?>">
<!-- Need to add this element and call click method, because calling submit()
on the form causes failed submission if the form has another element with name or id of submit.
See: https://developer.mozilla.org/en/DOM/form.submit#Specification -->
<input type="submit" style="display:none;" />
<?php <?php
if (array_key_exists('post', $this->data)) { if (array_key_exists('post', $this->data)) {
$post = $this->data['post']; $post = $this->data['post'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment