Automattic / Automattic/go-search-replace

Replace does not work for serialized data if the string does not end with a new line

Open
#35 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
108
Forks
19
PR merge metrics
No merged PRs in 30d

Description

To reproduce:

```
php -r 'echo serialize("aaaaabbbbbbbbbbaaaaa");' > test.txt
cat test.txt | ./go-search-replace bbbbbbbbbb ccccc
```

Expected result:
```
s:15:"aaaaacccccaaaaa";
```

Actual result: empty output

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the shown `php -r` command and pipe its output into `./go-search-replace`. Compare behavior when the serialized input lacks a trailing newline, then inspect the command's input-processing path. Done means the command emits `s:15:"aaaaacccccaaaaa";` instead of empty output for the reported input.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, php
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.