data)) { $post = $this->data['post']; } else { /* For backwards compatibility. */ assert('array_key_exists("response", $this->data)'); assert('array_key_exists("RelayStateName", $this->data)'); assert('array_key_exists("RelayState", $this->data)'); $post = array( 'SAMLResponse' => $this->data['response'], $this->data['RelayStateName'] => $this->data['RelayState'], ); } /** * Write out one or more INPUT elements for the given name-value pair. * * If the value is a string, this function will write a single INPUT element. * If the value is an array, it will write multiple INPUT elements to * recreate the array. * * @param string $name The name of the element. * @param string|array $value The value of the element. */ function printItem($name, $value) { assert('is_string($name)'); assert('is_string($value) || is_array($value)'); if (is_string($value)) { echo ''; return; } /* This is an array... */ foreach ($value as $index => $item) { printItem($name . '[' . $index . ']', $item); } } foreach ($post as $name => $value) { printItem($name, $value); } ?>