WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#6791 closed enhancement (fixed)

Eliminate closing ?>'s from wp-config-sample.php

Reported by: Otto42 Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.5
Component: General Keywords:
Focuses: Cc:

Description

One of the most frequent problems mentioned on the forum is the "blank line" problem. This is where some file contains a blank line before or after the <?php .. ?> tags that causes either header issues (which will prevent login's due to cookies not working) or causes invalid feed issues (which is recently a major problem with FeedBurner, since they stopped accepting invalid feeds).

It is described better here:
http://feedvalidator.org/docs/error/WPBlankLine.html

I recommend eliminating the use of the closing ?> tag in the wp-config.php file entirely. This will prevent text editors that introduce blank lines or excess spacing from breaking bits of the site by doing so. Since this file is pure PHP, the closing tag is optional anyway, and leaving it off ensures that the PHP interpreter does not produce output from it.

Reference this as well:
http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html

Attachments (1)

config.2.diff (295 bytes) - added by Otto42 6 years ago.
Patch to remove config file closing marker

Download all attachments as: .zip

Change History (5)

Otto426 years ago

Patch to remove config file closing marker

comment:1 jacobsantos6 years ago

If this is going to be done, then we should take a step further and remove the closing PHP tag from all WordPress library files.

comment:2 mrmist5 years ago

+1 for this.

comment:3 ryan5 years ago

  • Milestone changed from 2.9 to 2.8

comment:4 ryan5 years ago

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

(In [10252]) Eliminate closing ?>'s from wp-config-sample.php. Props Otto42. fixes #6791

Note: See TracTickets for help on using tickets.