On a fresh WordPress install in Linux distributions, wp-config-sample.php
contains Carriage Return control characters that are not found in any other .php file in the distribution.
Running
egrep -l $'\r'\$ *.php
in WP's base dir, will return only wp-config-sample.php
I am not worried about eliminating the control character, nor am I worried that it interferes with install operations (it doesn’t).
I’d just like to find out if there’s a reason why wp-config-sample.php
is the only file with this anomaly.
WP versions
Issue was reported in version 4.6.15. It is still present in the latest version 5.5
Environments
This behavior has been seen in
- Debian 10 CLI-only
- Ubuntu 18.04.4 LTS
- Ubuntu 12.04.5 LTS
- Ubuntu 20.04.1 LTS
WordPress distributions
Install files have been downloaded either
- as .zip file (e.g. wordpress-5.5.zip) or
- as .tar.gz file (e.g. wordpress-5.5.tar.gz)
Downloads methods
- via wget:
wget https://wordpress.org/latest.zip
- via WP CLI:
wp core download
- via a Web browser (in GUI environments)
Example screenshot from Ubuntu 12.04.5 LTS
A Google search doesn't provide any explanation. I have found only a similar question in the WP support forum but the reply given is "don't worry about it" and does not provide an explanation for it.
^M
characters inwp-config-sample.php
or in any of the other PHP files I randomly checked (index.php
,wp-includes/class-wp-oembed.php
). How are you downloading WordPress to your Linux environment?wp-config-sample.php
with vi from a command line?vi
. (Well, I suppose it'svim
, if we're getting technical -- specificallyVIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 15 2020 06:40:31)
.)