Fix nested HTML in submit_button(). fixes #15257, see #15064.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-10-30 06:14:15 +00:00
parent 089a7226f1
commit 6c03909488
1 changed files with 4 additions and 5 deletions

View File

@ -2149,12 +2149,11 @@ function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $
}
// Default the id attribute to $name unless an id was specifically provided in $other_attributes
$id = 'id="' . esc_attr( $name ) . '" ';
if ( is_array( $other_attributes ) && array_key_exists( 'id', $other_attributes ) ) {
$id = 'id="' . esc_attr( $other_attributes['id'] ) . '" ';
}
$id = $name;
if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) )
$id = $other_attributes['id'];
$button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . $id . '" class="' . esc_attr( $class );
$button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
$button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
if ( $wrap ) {