Skip to content

Commit 4b2a653

Browse files
committed
new value is allowed to be empty.
1 parent 1cc247e commit 4b2a653

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/Search_Replace_Command.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,13 @@ public function __invoke( $args, $assoc_args ) {
290290
$new = null !== $new_flag ? $new_flag : array_shift( $args );
291291

292292
// Validate that both old and new values are provided and not empty.
293-
if ( null === $old || null === $new || '' === $old || '' === $new ) {
293+
if ( null === $old || null === $new || '' === $old ) {
294294
$missing = array();
295295
if ( null === $old || '' === $old ) {
296296
$missing[] = '<old>';
297297
}
298-
if ( null === $new || '' === $new ) {
298+
// new value is allowed to be empty.
299+
if ( null === $new ) {
299300
$missing[] = '<new>';
300301
}
301302
$error_msg = count( $missing ) === 2

0 commit comments

Comments
 (0)