Skip to content

Commit 3c29e6a

Browse files
authored
Merge pull request #227 from wp-cli/fix/str_getcsv
Explicitly provide `$escape` to `str_getcsv`
2 parents a8de3f0 + 6a76a0c commit 3c29e6a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Context/Support.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,12 @@ protected function check_that_json_string_contains_json_string( $actual_json, $e
172172
* @return bool Whether $actual_csv contains $expected_csv
173173
*/
174174
protected function check_that_csv_string_contains_values( $actual_csv, $expected_csv ) {
175-
$actual_csv = array_map( 'str_getcsv', explode( PHP_EOL, $actual_csv ) );
175+
$actual_csv = array_map(
176+
static function ( $str ) {
177+
return str_getcsv( $str, ',', '"', '\\' );
178+
},
179+
explode( PHP_EOL, $actual_csv )
180+
);
176181

177182
if ( empty( $actual_csv ) ) {
178183
return false;

0 commit comments

Comments
 (0)