Skip to content

Commit

Permalink
Fix document IDs with invalid characters
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Aug 31, 2023
1 parent fe69b07 commit a0e8165
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Migration/Sources/Firebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ private function convertDocument(Collection $collection, array $document): Docum

$documentId = explode('/', $document['name']);
$documentId = end($documentId);
$documentId = preg_replace("/[^A-Za-z0-9\_\-]/", '', $documentId);
$documentId = strtolower($documentId);

return new Document($documentId, $collection->getDatabase(), $collection, $data, []);
}
Expand Down

0 comments on commit a0e8165

Please sign in to comment.