Skip to content

Commit

Permalink
fix: Replace non-word characters with -
Browse files Browse the repository at this point in the history
fixes #157
  • Loading branch information
marcelklehr committed May 15, 2024
1 parent a9d5ef0 commit aa98526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Service/GoogleDriveAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ private function downloadAndSaveFile(
* @return string name of the file to be saved
*/
private function getFileName(array $fileItem, string $userId, bool $hasNameConflict): string {
$fileName = preg_replace('/\\n/', '', preg_replace('/\//', '-', $fileItem['name'] ?? 'Untitled'));
$fileName = preg_replace('/[\n^\w]/', '-', preg_replace('/\//', '-', $fileItem['name'] ?? 'Untitled'));

if (in_array($fileItem['mimeType'], array_values(self::DOCUMENT_MIME_TYPES))) {
$documentFormat = $this->getUserDocumentFormat($userId);
Expand Down

0 comments on commit aa98526

Please sign in to comment.