WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 12 months ago

#4645 closed defect (bug) (duplicate)

Wordpress editor "forgets" everything after </textarea>

Reported by: Nosve Owned by:
Milestone: Priority: low
Severity: minor Version: 2.2
Component: General Keywords: forms textarea needs-patch
Focuses: Cc:

Description

I have two pages, 'Content' and 'Feedback', on the Wordpress-based site redesign I'm working on (http://www.genocideintervention.net/testdrive/wordpress) that have forms on them. Most of the form's inputs (text and textarea types) appear just fine. However, there is a bug regarding the 'submit' button of either form. As soon as I add the button to the page code and save, it appears on the site just fine. If I ever go back to the page editor and edit the page further, however, it's as if the site forgets the button ever existed. The submit button disappears from the page, along with the <tr> and <td> that it was contained in. Even more strangely, the submit button isn't even really gone--it appears in the page editor window, right below the page content text box, as you can see in the attached screencap. It has just disappeared from the code and the site.

I know the form works--I've tested it during the times immediately proceeding my adding the submit button code. But having to rewrite my submit <td> after every tweak is driving me mad! And while I don't know if this bug could have malicious applications, having page code apparently executing within the editor can't be a good thing...

Attachments (1)

screencap.jpg (46.1 KB) - added by Nosve 8 years ago.
Submit button no longer appearing in the code but appearing below the text box in the editor window

Download all attachments as: .zip

Change History (18)

@Nosve8 years ago

Submit button no longer appearing in the code but appearing below the text box in the editor window

comment:1 @Nosve8 years ago

  • Milestone set to 2.2.2

The form code that this happening with:

<form action="http://www.genocideintervention.net/testdrive/wordpress/feedbackcode.php" method="post">
<table summary="feedback form" border="0" cellpadding="5" cellspacing="5">
<tr>
<td><label for="name">Name:</label></td>
<td><input name="name" size="25" class="contact" type="text" /></td>
</tr>
<tr>
<td><label for="email">Email address:</label></td>
<td><input name="email" size="25" class="contact" type="text" /></td>
</tr>
<tr>
<td><label for="official">Who you called:</label></td>
<td><input name="official" size="25" class="contact" type="text" /></td>
</tr>
<tr>
<td colspan="2"><label for="comments">Comments:</label><textarea rows="15" cols="45" name="comments" class="contact"></textarea></td>
</tr>
<!-- this is the part that disappears -->
<tr>
<td colspan="2">
<input type="submit" value="Send Feedback" /><br />
</td>
</tr>
<!-- /disappear -->
</table>
</form>

comment:2 @Nosve8 years ago

  • Priority changed from normal to high

comment:3 @Otto428 years ago

Turn off the visual editor entirely. Does it still happen then?

comment:4 @Nazgul8 years ago

It's not the buttons that "dissapear".

It's everything after the </textarea>, because that's being interpreted as the end of the editors textarea.

comment:5 @Nosve8 years ago

Nazgul appears to be right. Once I took out the textarea, the 'submit' button appeared just fine.

That the page interprets an entered </textarea> as the end of the editor is bad, though. I'll put up a screencap in a second, but this bug also makes it so you can enter unescaped PHP into the page editor. Seems like a security risk to me.

comment:6 @rob1n8 years ago

Wouldn't it only be a security risk if it actually executed it?

I can type PHP code on this page right now and it's not a security problem...

comment:7 @Nazgul8 years ago

It's not a security risk.

You need the unfiltered_html capability to include javascript/raw php in your pages/posts, which by default is only given to administrators.

Contributers don't have that capability and therefore can't abuse it, because script tags and the like are filtered out.

comment:8 @Nazgul8 years ago

  • Summary changed from Wordpress page editor "forgets" submit button on form to Wordpress editor "forgets" everything after </textarea>

comment:9 @Nosve8 years ago

  • Priority changed from high to normal

Strike that, you're right. It appeared that it wasn't escaping the post-<textarea> PHP code but now it seems that that was because I was testing with echo() instead of something more interesting.

So this bug is simply a headache for anyone who wants to have forms on their blog. :)

comment:10 @Nosve8 years ago

  • Keywords textarea added; submit removed

comment:11 @foolswisdom8 years ago

  • Keywords needs-patch added
  • Milestone changed from 2.2.2 to 2.4 (future)

comment:12 @andy7 years ago

  • Milestone changed from 2.5 to 2.6
  • Priority changed from normal to low
  • Severity changed from major to minor

Uncommon usage. Maybe a shortcode for textarea?

comment:13 @Nazgul7 years ago

  • Milestone 2.6 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #6449.

comment:14 follow-up: @maxaud12 months ago

I have a custom post type on my site that I'm using for forms that are being displayed in multiple location that then get inserted through a shortcode. Since the visual editor isn't needed for raw HTML on these forms I turn it off on these pages using
add_filter( 'user_can_richedit', '__return_false' );
I'm encountering this bug when doing so. Am I out of luck and forced to use the rich text editor for this?

comment:15 in reply to: ↑ 14 ; follow-up: @sabreuse12 months ago

Please use the support forum, http://wordpress.org/support

Replying to maxaud:

I have a custom post type on my site that I'm using for forms that are being displayed in multiple location that then get inserted through a shortcode. Since the visual editor isn't needed for raw HTML on these forms I turn it off on these pages using
add_filter( 'user_can_richedit', '__return_false' );
I'm encountering this bug when doing so. Am I out of luck and forced to use the rich text editor for this?

comment:16 in reply to: ↑ 15 @maxaud12 months ago

Replying to sabreuse:

Please use the support forum, http://wordpress.org/support

This bug still exists. Is this not where one would state that?

comment:17 @Otto4212 months ago

This is a six year old closed bug ticket.

Yes, this is not where one would state that. One should go to the support forums first, and attempt to find help in resolving the problem.

Only if a bug was determined to exist would one post to this tracker, and even then, they wouldn't leave a comment on a six-year old "fixed" ticket, they would start a new one, with fresh details.

Note: See TracTickets for help on using tickets.