Make WordPress Core

Changeset 46222


Ignore:
Timestamp:
09/20/2019 10:43:50 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Remove a workaround for str_getcsv().

The str_getcsv() function was introduced in PHP 5.3.0, so no longer needs a polyfill.

Props jrf.
Fixes #48074.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/utils.php

    r46215 r46222  
    371371function mask_input_value( $in, $name = '_wpnonce' ) {
    372372    return preg_replace( '@<input([^>]*) name="' . preg_quote( $name ) . '"([^>]*) value="[^>]*" />@', '<input$1 name="' . preg_quote( $name ) . '"$2 value="***" />', $in );
    373 }
    374 
    375 if ( ! function_exists( 'str_getcsv' ) ) {
    376     function str_getcsv( $input, $delimiter = ',', $enclosure = '"', $escape = '\\' ) {
    377         $fp = fopen( 'php://temp/', 'r+' );
    378         fputs( $fp, $input );
    379         rewind( $fp );
    380         $data = fgetcsv( $fp, strlen( $input ), $delimiter, $enclosure );
    381         fclose( $fp );
    382         return $data;
    383     }
    384373}
    385374
Note: See TracChangeset for help on using the changeset viewer.