Skip to content
Snippets Groups Projects
Unverified Commit 35d9969b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4

(cherry picked from commit 9cf58fe1)
parent deead9fd
No related branches found
No related tags found
1 merge request!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4
Pipeline #343263 passed with warnings
Pipeline: drupal

#343300

    Pipeline: drupal

    #343297

      Pipeline: drupal

      #343283

        +1
        ......@@ -98,7 +98,7 @@ public function mail(array $message) {
        if (in_array(strtolower($name), self::MAILBOX_LIST_HEADERS, TRUE)) {
        // Split values by comma, but ignore commas encapsulated in double
        // quotes.
        $value = str_getcsv($value, ',');
        $value = str_getcsv($value, escape: '\\');
        }
        $headers->addHeader($name, $value);
        }
        ......
        ......@@ -127,7 +127,7 @@ public function mail(array $message) {
        if (in_array(strtolower($name), self::MAILBOX_LIST_HEADERS, TRUE)) {
        // Split values by comma, but ignore commas encapsulated in double
        // quotes.
        $value = str_getcsv($value, ',');
        $value = str_getcsv($value, escape: '\\');
        }
        $headers->addHeader($name, $value);
        }
        ......
        ......@@ -125,7 +125,7 @@ public function testMigrationState(): void {
        // Assert that each discovered migration has a corresponding declaration
        // in a migrate_drupal.yml.
        foreach ($discovered_unique as $datum) {
        $data = str_getcsv($datum);
        $data = str_getcsv($datum, escape: '');
        $in_finished = in_array($datum, $declared_unique[MigrationState::FINISHED]);
        $in_not_finished = in_array($datum, $declared_unique[MigrationState::NOT_FINISHED]);
        $found = $in_finished || $in_not_finished;
        ......@@ -137,7 +137,7 @@ public function testMigrationState(): void {
        // not finished.
        $discovered_not_finished = array_diff($discovered_unique, $declared_unique[MigrationState::FINISHED]);
        foreach ($discovered_not_finished as $datum) {
        $data = str_getcsv($datum);
        $data = str_getcsv($datum, escape: '');
        $this->assertContains($datum, $declared_unique[MigrationState::NOT_FINISHED], sprintf("No migration found for version '%s' with source_module '%s' and destination_module '%s' declared in module '%s'", $version, $data[1], $data[2], $data[0]));
        }
        }
        ......
        ......@@ -184,9 +184,9 @@ protected function readMultilingualContent($filename) {
        foreach ($translated_languages as $language) {
        if (file_exists($default_content_path . "$language/$filename") &&
        ($handle = fopen($default_content_path . "$language/$filename", 'r')) !== FALSE) {
        $header = fgetcsv($handle);
        $header = fgetcsv($handle, escape: '');
        $line_counter = 0;
        while (($content = fgetcsv($handle)) !== FALSE) {
        while (($content = fgetcsv($handle, escape: '')) !== FALSE) {
        $keyed_content[$language][$line_counter] = array_combine($header, $content);
        $line_counter++;
        }
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment