Fixing document validation for swf files

skala
Julio Montoya 14 years ago
parent b90b6d851b
commit ffb5518658
  1. 7
      main/document/download.php

@ -70,7 +70,7 @@ if (substr($refer_script, 0, 15) == '/fillsurvey.php') {
//the character "-" the filename was changed from "-" to "_" in the DB for no reason
$path_info = pathinfo($doc_url);
$fix_file_name = false;
if (isset($path_info['extension']) == 'swf') {
if (isset($path_info['extension']) && $path_info['extension'] == 'swf') {
$original_doc_url = $doc_url;
$doc_url = str_replace('_', '-', $doc_url);
$fix_file_name = true;
@ -78,13 +78,10 @@ if (isset($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;
// Check visibility of document and paths
if ($fix_file_name) {
$doc_url = $original_doc_url;
}
// Check visibility of document and paths
$is_visible = DocumentManager::is_visible($doc_url, $_course, api_get_session_id());
//Documents' slideshow thumbnails

Loading…
Cancel
Save