We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To reproduce:
php -r 'echo serialize("aaaaabbbbbbbbbbaaaaa"), PHP_EOL;' > test.txt cat test.txt | ./go-search-replace bbbbbbbbbb ccccc cat test.txt | ./go-search-replace bbbbbbbbbb ccccccccccccccc
Expected result:
s:15:"aaaaacccccaaaaa"; s:25:"aaaaacccccccccccccccaaaaa";
Actual result:
s:20:"aaaaacccccaaaaa"; s:20:"aaaaacccccccccccccccaaaaa";
The text was updated successfully, but these errors were encountered:
This is because go-search-replace expects the quote marks to be escaped. Whether that's a bug or not I don't know.
$ php -r 'echo addslashes( serialize("aaaaabbbbbbbbbbaaaaa") ), PHP_EOL;' > test.txt $ cat test.txt s:20:\"aaaaabbbbbbbbbbaaaaa\"; $ cat test.txt | go-search-replace bbbbbbbbbb ccccc s:15:\"aaaaacccccaaaaa\"; $ cat test.txt | go-search-replace bbbbbbbbbb ccccccccccccccc s:25:\"aaaaacccccccccccccccaaaaa\";
Sorry, something went wrong.
But then it does not work on statements like
INSERT INTO `wp_options` (option_name, option_value) VALUES ('test', 's:15:"aaaaacccccaaaaa";');
Double quotes inside single quotes do not have to be escaped.
I think WP always escapes the quotes, but if you're seeing otherwise it should be fine to change the regex
https://github.com/Automattic/go-search-replace/blob/master/search-replace.go#L17-L18
No branches or pull requests
To reproduce:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: