WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5327 closed defect (bug) (invalid)

Possible stupid bug of the plugin system

Reported by: gnot Owned by:
Milestone: Priority: high
Severity: blocker Version: 2.3.1
Component: General Keywords:
Focuses: Cc:

Description

I have just wasted 4+ hours because WP breaks horribly without any warning or error message when there is more than one empty line under the last ?> tag in the source code of a plugin. I found out about this accidentally while trying desperately to fix a problem with a plugin of mine.

Can anybody confirm this?

The only thing I do not want to read is that it is a feature or a necessary evil or anything similar... Thanks

Change History (6)

comment:1 gnot6 years ago

  • Milestone 2.5 deleted

comment:2 santosj6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

This isn't a WordPress issue. It is a PHP issue. It is a common problem with a known solution. All WordPress files must not have more than one empty line (none would be better).

If you remove the ?> from PHP only files, it would prevent this from happening again.

comment:3 gnot6 years ago

Damn, I do not want to write anything in PHP again...

comment:4 santosj6 years ago

Why?

Most likely what happened was that you have display_errors set to '0', which is why no errors or warnings came up. If you had turned it on, you most likely would have received an error about trying to send headers after they were already sent (Most common cause of this happening).

All languages are going to have little "gotchas" that you have to figure out. It technically isn't a PHP issue either, since it is the expected behavior and documented.

comment:5 santosj6 years ago

Well, at least now you know and knowing is half the battle. The other half is fixing or preventing it from happening again. That and turning on Display Errors on your development server (if not already on).

comment:6 gnot6 years ago

Problem is that I was trying to fix the plugin on my live blog :)
Anyway, despite my anger about the wasted time, I'd like to thank you for the information. I am not a professional.

Note: See TracTickets for help on using tickets.