Skip to content

PHP 8.4 ValueError when str_getcsv() receives empty enclosure #166

Description

@richardlhr

Fixes a PHP 8+ compatibility issue in SendPress_Data::csv_to_array().

When csv_to_array() is called without an enclosure argument, the default value is an empty string:

$enclosure = '';
This value is then passed directly to:

str_getcsv($csv_line, $delimiter, $enclosure);
PHP 8+ now throws:

ValueError: str_getcsv(): Argument #3 ($enclosure) must be a single character
because the enclosure parameter must contain exactly one character.

I created a PR with the fix: #165

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions