Skip to content

wp config shuffle-salts adds an extra line feed to most lines #160

@rklrkl

Description

@rklrkl

Bug Report

Describe the current, buggy behaviour

If I run "wp config shuffle-salts" using WP-CLI 2.8.1, the updated wp-config.php file ends up with an extra line feed (i.e. at least two of them) on the end of most lines, giving a "double line spaced" look to the file.

Describe how other contributors can replicate this bug

After running "wp config shuffle-salts", a "hexdump -C wp-config.php | less" shows multiple 0a (line feed) endings and just running "less wp-config.php" shows double line spaced output (even in comment sections).

Let us know what environment you are running this on

OS: Linux 4.18.0-425.13.1.el8_7.x86_64 #1 SMP Tue Feb 21 04:20:52 EST 2023 x86_64
Shell: /bin/bash
PHP binary: /opt/remi/php81/root/usr/bin/php
PHP version: 8.1.21
php.ini used: /etc/opt/remi/php81/php.ini
MySQL binary: /bin/mysql
MySQL version: mysql Ver 15.1 Distrib 10.11.4-MariaDB, for Linux (x86_64) using readline 5.1
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: [redacted]
WP-CLI packages dir:
WP-CLI cache dir: [redacted]
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.8.1

Provide a possible solution

Don't add an extra line feed to the end of lines :-)

Provide additional context/Screenshots

This problem is annoying, especially since you have to write a script to remove the additional line feeds.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions