Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize white space in file names #24

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

jekuaitk
Copy link
Collaborator

  • Normalizes white space in file names.

@jekuaitk jekuaitk requested a review from rimi-itk December 18, 2024 16:06
@@ -61,6 +61,9 @@ public function AddToDocumentLibrary(string $filePath, string $caseId, string $f
// https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions).
$fileName = preg_replace('@[<>:"/\\\\|?*]@', '_', $fileName);

// Normalize white space.
$fileName = preg_replace('/[[:space:]]/', ' ', $fileName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider trimming the value to get rid of any leading and trailing whitespace.

@jekuaitk jekuaitk requested a review from rimi-itk December 19, 2024 09:30
@jekuaitk jekuaitk merged commit 59eca06 into develop Dec 19, 2024
4 checks passed
@jekuaitk jekuaitk deleted the feature/normalize-white-space-in-filenames branch December 19, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants