Skip to content

Commit

Permalink
Merge pull request #64 from nextcloud/fix/folder-permission-tmp-dir
Browse files Browse the repository at this point in the history
fix: create tmp folder to store docs as 0700
  • Loading branch information
kyteinsky authored Apr 15, 2024
2 parents 60f2a5d + dc3579c commit a4dc94f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Service/AssistantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function parseTextFromFile(string $filePath, string $userId): string {
$tempFilePath = sys_get_temp_dir() . '/assistant_app/' . uniqid() . '.tmp';
// Make sure the temp dir exists
if (!file_exists(dirname($tempFilePath))) {
mkdir(dirname($tempFilePath), 0600, true);
mkdir(dirname($tempFilePath), 0700, true);
}
file_put_contents($tempFilePath, $contents);

Expand Down Expand Up @@ -494,7 +494,6 @@ private function parseDocument(string $filePath, string $mimeType): string {
foreach ($sections as $section) {
$elements = $section->getElements();
foreach ($elements as $element) {
$class = get_class($element);
if (method_exists($element, 'getText')) {
$outText .= $element->getText() . "\n";
}
Expand Down

0 comments on commit a4dc94f

Please sign in to comment.