Unverified Commit 9cf58fe1 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

parent 0b78493d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }
+1 −1
Original line number Diff line number Diff line
@@ -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);
        }
+2 −2
Original line number Diff line number Diff line
@@ -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]));
    }
  }
+2 −2
Original line number Diff line number Diff line
@@ -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++;
        }