Adding exit function when calling export_table_XXX or file_send_for_download() to avoid exporting html content

skala
Julio Montoya 15 years ago
parent 46a48b3792
commit 23e511c7f2
  1. 5
      main/admin/user_export.php
  2. 1
      main/announcements/download.php
  3. 1
      main/calendar/download.php
  4. 4
      main/document/download.php
  5. 2
      main/gradebook/gradebook_view_result.php
  6. 3
      main/gradebook/open_document.php
  7. 5
      main/group/group_overview.php
  8. 5
      main/mySpace/index.php
  9. 1
      main/mySpace/myStudents.php
  10. 1
      main/mySpace/session.php
  11. 1
      main/mySpace/student.php
  12. 3
      main/newscorm/aicc.class.php
  13. 1
      main/newscorm/lp_stats.php
  14. 3
      main/tracking/courseLog.php
  15. 2
      main/user/user.php

@ -148,13 +148,14 @@ if ($form->validate())
$data[] = $user ;
}
switch($file_type)
{
switch($file_type) {
case 'xml':
Export::export_table_xml($data,$filename,'Contact','Contacts');
exit;
break;
case 'csv':
Export::export_table_csv($data,$filename);
exit;
break;
}
}

@ -88,6 +88,5 @@ $result= Database::query($sql, __FILE__, __LINE__);
$row= Database::fetch_array($result);
$title = str_replace(' ','_', $row['filename']);
DocumentManager::file_send_for_download($full_file_name,TRUE, $title);
exit;
?>

@ -88,6 +88,5 @@ $result= Database::query($sql, __FILE__, __LINE__);
$row= Database::fetch_array($result);
$title = str_replace(' ','_', $row['filename']);
DocumentManager::file_send_for_download($full_file_name,TRUE, $title);
exit;
?>

@ -122,5 +122,5 @@ if (!$is_allowed_to_edit &&
}
DocumentManager::file_send_for_download($full_file_name);
?>
exit;
?>

@ -363,9 +363,11 @@ if ($export_result_form->validate()) {
switch ($file_type) {
case 'xml' :
Export :: export_table_xml($alldata, $filename, 'Result', 'XMLResults');
exit;
break;
case 'csv' :
Export :: export_table_csv($alldata, $filename);
exit;
break;
}
}

@ -25,4 +25,5 @@
require_once ('../inc/global.inc.php');
require_once ('../inc/lib/document.lib.php');
api_block_anonymous_users();
DocumentManager :: file_send_for_download(api_get_path(SYS_COURSE_PATH).$_GET['file']);
DocumentManager :: file_send_for_download(api_get_path(SYS_COURSE_PATH).$_GET['file']);
exit;

@ -80,12 +80,13 @@ if( isset($_GET['action']))
$data[] = $row;
}
}
switch($_GET['type'])
{
switch($_GET['type']) {
case 'csv':
Export::export_table_csv($data);
exit;
case 'xls':
Export::export_table_xls($data);
exit;
}
break;
}

@ -662,10 +662,8 @@ if ($is_platform_admin && $view == 'admin') {
// send the csv file if asked
if ($export_csv) {
ob_end_clean();
/*echo "<pre>";
print_r($csv_content);
echo "</pre>";*/
Export :: export_table_csv($csv_content, 'reporting_index');
exit;
}
//footer
@ -796,6 +794,7 @@ function export_tracking_user_overview() {
}
}
Export :: export_table_csv($csv_content, 'reporting_user_overview');
exit;
}
/**

@ -1210,6 +1210,7 @@ if (!empty ($_GET['student'])) {
if ($export_csv) {
ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_student');
exit;
}
/*
==============================================================================

@ -143,6 +143,7 @@ if ($nb_sessions > 0) {
if ($export_csv) {
ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_student_list');
exit;
}
} else {
get_lang('NoSession');

@ -271,6 +271,7 @@ if ($isCoach || api_is_platform_admin() || $_user['status'] == DRH) {
if ($export_csv) {
ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_student_list');
exit;
}
}

@ -675,7 +675,7 @@ class aicc extends learnpath {
$result = Database::query($sql, __FILE__, __LINE__);
$row = Database::fetch_array($result);
$LPname = $row['path'];
$list = split('/',$LPname);
$list = split('/',$LPname);
$LPnamesafe = $list[0];
//$zipfoldername = '/tmp';
//$zipfoldername = '../../courses/'.$_course['directory']."/temp/".$LPnamesafe;
@ -702,6 +702,7 @@ class aicc extends learnpath {
// Delete the temporary zip file and directory in fileManage.lib.php
my_delete($zipfilename);
my_delete($zipfoldername);
return true;
}

@ -768,6 +768,7 @@ if (!empty($export_csv)) {
$csv_content[] = $temp;
ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_learning_path_details');
exit;
}
if ($origin != 'tracking') {

@ -607,6 +607,7 @@ if ($_GET['studentlist'] == 'false') {
if ($export_csv) {
ob_end_clean();
Export :: export_table_csv($csv_content, 'reporting_course_tracking');
exit;
}
} elseif ($_GET['studentlist'] == 'true' or $_GET['studentlist'] == '') {
// else display student list with all the informations
@ -731,8 +732,8 @@ if ($_GET['studentlist'] == 'false') {
ob_end_clean();
array_unshift($csv_content, $csv_headers); // adding headers before the content
Export :: export_table_csv($csv_content, 'reporting_student_list');
exit;
}
} elseif($_GET['studentlist'] == 'resources') {
// Create a search-box

@ -132,8 +132,10 @@ if (api_is_allowed_to_edit()) {
switch ($_GET['type']) {
case 'csv' :
Export::export_table_csv($a_users);
exit;
case 'xls' :
Export::export_table_xls($a_users);
exit;
}
}
}

Loading…
Cancel
Save