Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#30534 closed defect (bug) (fixed)

class-phpass.php EOF and closing PHP tag

Reported by: amandato's profile amandato Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.0.1
Component: Login and Registration Keywords: has-patch
Focuses: Cc:

Description

I caught this while auditing the changes between 4.0 and 4.0.1...

The very end of the class-phpass.php file has a new line after the ending ?> php tag. I looked at other files in the wp-includes folder and didn't see this in any of the others. I've been told one of the recommended PHP coding practices is to leave out the closing php tag to prevent situations like this. I would simply remove that carriage return and leave the closing ?> since a majority of the other wp-include files end with ?>, but I'll leave that decision to whom ever manages this obviously.

Thanks and Happy Thanksgiving.

Attachments (1)

30534.diff (253 bytes) - added by iamfriendly 9 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
10 years ago

Missed in [19712], probably because it was considered an external library.

#2 @dd32
10 years ago

FWIW, A single line break after the closing ?> is not a problem in itself, and won't be output on the page, as PHP will deliberately eat it. I believe that goes back to the days when editing environments required all files to end with a single blank line.

#3 @iamfriendly
9 years ago

I know this is basically the smallest change in history, but I'm just ploughing through tickets, so thought what the hell.

@iamfriendly
9 years ago

#4 @iamfriendly
9 years ago

  • Keywords has-patch added

#5 @jeremyfelt
9 years ago

  • Milestone changed from Awaiting Review to 4.4

I don't know the history here - do we still consider PasswordHash an upstream library that we track, or can we get rid of the closing ?>?

We should go one way or the other in 4.4. :)

#6 @SergeyBiryukov
9 years ago

There were several commits to that file in the last 2 years, so I guess we can do this.

#7 @SergeyBiryukov
9 years ago

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

In 34887:

Remove closing PHP tag from wp-includes/class-phpass.php.

Previously: [19712], [28678].

Props iamfriendly, amandato.
Fixes #30534.

Note: See TracTickets for help on using tickets.