Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#21703 closed defect (bug) (invalid)

wp-comments-post.php missing closing angle bracket in 3.4.1

Reported by: jonjerome Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: General Keywords: close
Focuses: Cc:


A user reported to me that when leaving comments in Safari, his browser would hang on a blank page with wp-comments-post.php in the URL bar. Looking at the file itself I noticed that the current version is missing ?> from the end of the file to close php. Editing the file to add it manually solved the problem for my user without apparent ill effects for anyone else.

Browsing source, I see that the missing angle bracket was present in 3.3 so I assume it is an oversight. It seems to only affect Safari.

Change History (5)

#1 @ocean90
6 years ago

  • Keywords close added

This is intentional, see #12307.

#2 follow-up: @jonjerome
6 years ago

Seems like that decision should be revisited if it is breaking people's browsers.

#3 @ocean90
6 years ago

Any plugins active? Can you reproduce it on a clean install with the default theme? If yes, what are the steps to reproduce the issue? Any output if WP_DEBUG is true?

#4 in reply to: ↑ 2 @nacin
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Replying to jonjerome:

Seems like that decision should be revisited if it is breaking people's browsers.

Closing tags are not required in PHP, and don't have any affect on the browser. At most, they prevent a developer error from arising whereby whitespace is accidentally left after the closing ?> tag, which is just as bad as being left before <?php but is more difficult to spot.

If I had to guess, the blank page is an error elsewhere, maybe a fatal error in a plugin. Or, the redirect is firing but you have whitespace leaking into the body via wp-config.php or some other file, and somehow Safari s choking on it. Have you actually confirmed this with Safari? I wouldn't be surprised if it had nothing to do with it. You can inspect the request using an HTTP client or something like webkit's inspector to see what is actually going on.

#5 @jonjerome
6 years ago

Unfortunately I cannot run Safari so I am reliant on my user to send me information. It did occur to me to try it in Chromium so that I'd at least be using a webkit browser of some sort, but I was unable to reproduce the problem there. I'll check wp-config at least though; I assume you mean whitespace after the closing tag. Thanks for the info.

Note: See TracTickets for help on using tickets.