Minor - format code, fix php path

pull/2458/head
jmontoyaa 8 years ago
parent 5a3b7d73b0
commit 938e6b8b28
  1. 6
      main/document/download.php
  2. 6
      main/document/edit_paint.php
  3. 10
      main/document/save_pixlr.php

@ -82,7 +82,7 @@ if (isset($path_info['extension']) && $path_info['extension'] == 'swf') {
}
if (Security::check_abs_path($sys_course_path.$doc_url, $sys_course_path.'/')) {
$full_file_name = $sys_course_path.$doc_url;
$fullFileName = $sys_course_path.$doc_url;
if ($fix_file_name) {
$doc_url = $fixed_url;
}
@ -102,8 +102,8 @@ if (Security::check_abs_path($sys_course_path.$doc_url, $sys_course_path.'/')) {
}
// Launch event
Event::event_download($doc_url);
$download = (!empty($_GET['dl']) ? true : false);
$result = DocumentManager::file_send_for_download($full_file_name, $download);
$download = !empty($_GET['dl']) ? true : false;
$result = DocumentManager::file_send_for_download($fullFileName, $download);
if ($result === false) {
api_not_allowed(true);
}

@ -39,14 +39,14 @@ if (empty($document_data)) {
//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
$dir = str_replace('\\', '/', $dir);
if (empty($dir)) {
$dir = '/';
}
/* Constants & Variables */
$current_session_id = api_get_session_id();
//path for pixlr save
Session::write('paint_dir', Security::remove_XSS($dir));
if ($dir == '/') {
Session::write('paint_dir', '');
}
Session::write('paint_file', basename(Security::remove_XSS($file_path)));
$get_file = Security::remove_XSS($file_path);
$file = basename($get_file);

@ -136,10 +136,10 @@ if (empty($temp_file_2delete)) {
}
$documentPath = $saveDir.'/'.$paintFileName;
//add new document to disk
// Add new document to disk
file_put_contents($documentPath, $contents);
//add document to database
$documentId = add_document($courseInfo, $paintDir.'/'.$paintFileName, 'file', filesize($documentPath), $title);
// Add document to database
$documentId = add_document($courseInfo, $paintDir.$paintFileName, 'file', filesize($documentPath), $title);
if ($documentId) {
api_item_property_update(
$courseInfo,
@ -167,7 +167,7 @@ if (empty($temp_file_2delete)) {
exit;
}
if ($paintFile == $paintFileName) {
$documentId = DocumentManager::get_document_id($courseInfo, $paintDir.'/'.$paintFileName);
$documentId = DocumentManager::get_document_id($courseInfo, $paintDir.$paintFileName);
update_existing_document($courseInfo, $documentId, filesize($documentPath), null);
api_item_property_update(
$courseInfo,
@ -185,7 +185,7 @@ if (empty($temp_file_2delete)) {
//add a new document
$documentId = add_document(
$courseInfo,
$paintDir.'/'.$paintFileName,
$paintDir.$paintFileName,
'file',
filesize($documentPath),
$title

Loading…
Cancel
Save