Skip to content
Snippets Groups Projects
Commit 007537f8 authored by Vinciane's avatar Vinciane
Browse files

FEAT #8489 PJ name without forbidden characters

parent 71f8639e
No related branches found
No related tags found
No related merge requests found
......@@ -349,6 +349,10 @@ class AttachmentController
$encodedDocument = base64_encode($fileContent);
if (!empty($document['title'])) {
$document['title'] = preg_replace(utf8_decode('@[\\/:*?"<>|]@i'), '_', substr($document['title'], 0, 30));
}
$pathInfo = pathinfo($pathToDocument);
$fileName = (empty($document['title']) ? 'document' : $document['title']) . ".{$pathInfo['extension']}";
......
......@@ -570,7 +570,7 @@ class ResController
$encodedDocument = base64_encode($fileContent);
if (!empty($document['subject'])) {
$document['subject'] = preg_replace(utf8_decode('@[^a-zA-Z0-9_-s.]@i'), '_', substr($document['subject'], 0, 30));
$document['subject'] = preg_replace(utf8_decode('@[\\/:*?"<>|]@i'), '_', substr($document['subject'], 0, 30));
}
$pathInfo = pathinfo($pathToDocument);
......
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