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: http://simplesamlphp.googlecode.com/svn/trunk@3024 44740490-163a-0410-bde0-09ae8108e29a
This commit is contained in:
olavmrk 2012-01-27 07:02:56 +00:00
parent f4aabe3246
commit fe8e1c4d6a
1 changed files with 5 additions and 1 deletions

View File

@ -5,13 +5,17 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>POST data</title>
</head>
<body onload="document.forms[0].submit()">
<body onload="document.getElementsByTagName('input')[0].click();">
<noscript>
<p><strong>Note:</strong> Since your browser does not support JavaScript, you must press the button below once to proceed.</p>
</noscript>
<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
if (array_key_exists('post', $this->data)) {
$post = $this->data['post'];