New issue

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

Escape `$n` and `\\n` sequences in preg_replace() values #3

merged 5 commits into from Mar 20, 2018


3 participants

danielbachhuber commented Mar 20, 2018

Fixes #2

@danielbachhuber danielbachhuber added this to the 1.2.1 milestone Mar 20, 2018

@danielbachhuber danielbachhuber requested a review from wp-cli/committers Mar 20, 2018

array( 'abc$12345de' ),
array( '$abcde12345' ),
array( '123$abcde45' ),
array( '\\\\12345abcde' ),

This comment has been minimized.


danielbachhuber Mar 20, 2018


According to this test, it's not necessary to escape the \\12345 sequence.


This comment has been minimized.


fjarrett commented Mar 20, 2018

@danielbachhuber Thanks for taking this off my todo list today! 😁

@schlessera schlessera added the bug label Mar 20, 2018

@schlessera schlessera merged commit 6ce0a9f into master Mar 20, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@schlessera schlessera deleted the 2-escape-dollar branch Mar 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment