Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#27071 closed defect (bug) (fixed)

Invalid HTML produced by get_the_password_form

Reported by: andykeith's profile andykeith Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 3.8.2 Priority: normal
Severity: normal Version: 3.7
Component: Posts, Post Types Keywords: has-patch commit fixed-major needs-unit-tests
Focuses: Cc:


There seems to be a bug with the HTML returned by get_the_password_form (post-template.php). There's a line break between lines 1251 and 1252 (the closing </p> tag surrounding the input and the closing </form> tag). This causes an extra </p> to be generated by the browser. So the output on a password-proteced post looks like this:

<form action="http://localhost/themedev/wp-login.php?action=postpass" class="post-password-form" method="post">
<p>This content is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-611">Password: <input name="post_password" id="pwbox-611" type="password" size="20" /></label> <input type="submit" name="Submit" value="Submit" /></p>

Simple fix - just need to remove this line break and it works fine.

Attachments (1)

27071.patch (1.1 KB) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
10 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 3.9
  • Version changed from 3.8.1 to 3.7

Confirmed. It's not the line break, it's the extra tab. [25010] accidentally reverted [21124] and reintroduced #21018.

We should probably look into wpautop() (see ticket:21018:1 and ticket:21018:21018.diff), but at least let's fix the regression here.

#2 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 27134:

Fix validation issue in get_the_password_form() caused by wpautop().

props andykeith.
fixes #27071.

#3 @SergeyBiryukov
10 years ago

  • Keywords fixed-major added
  • Milestone changed from 3.9 to 3.8.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 3.8.2 consideration.

#4 @nacin
10 years ago

  • Keywords needs-unit-tests added

This would strongly benefit from a unit test.

#5 @nacin
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 27874:

Fix validation issue in get_the_password_form() caused by wpautop().

Merges [27134] to the 3.8 branch.

props andykeith.
fixes #27071.

Note: See TracTickets for help on using tickets.