Skip to content

Commit

Permalink
Mindmap save: add explicit extension to disk filename
Browse files Browse the repository at this point in the history
--HG--
branch : 3.12
  • Loading branch information
adia committed Dec 20, 2021
1 parent 83bf73e commit 3026844
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/document/index.php
Expand Up @@ -116,7 +116,7 @@
$mindmap = $_GET['mindmap'];
$title = $_GET['mindtitle'];

$file_path = '/' . safe_filename(get_file_extension($filename));
$file_path = '/' . safe_filename('jm');
if (!file_put_contents($basedir . $file_path, $_GET['mindmap'])) {
Session::Messages($langGeneralError, 'alert-danger');
} else {
Expand Down Expand Up @@ -152,7 +152,7 @@
$language, $uid);
Session::Messages($langMindMapSaved,"alert-success");
}
redirect_to_home_page('modules/mindmap/?course=' . $course_code);
redirect_to_home_page('modules/document/?course=' . $course_code);
}


Expand All @@ -165,8 +165,7 @@
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$fileData = base64_decode($img);
$safe_fileName = safe_filename(get_file_extension($filename));
$file_path = '/' . $safe_fileName;
$file_path = '/' . safe_filename('png');
$file_date = date('Y-m-d G:i:s');

// mindmap save in database
Expand Down

0 comments on commit 3026844

Please sign in to comment.