From 45c0d224902c0fccf553615759a830568d4f49e8 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 12 Aug 2008 15:09:46 +0000 Subject: [PATCH] MDL-16007 remoevd dontdie param from sent_temp_file() --- lib/filelib.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/filelib.php b/lib/filelib.php index b6b5921490..2340d6f9d2 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -567,24 +567,18 @@ function get_mimetype_description($mimetype,$capitalise=false) { * @param string $path path to file, preferably from moodledata/temp/something; or content of file itself * @param string $filename proposed file name when saving file * @param bool $path is content of file - * @param bool $dontdie - return control to caller afterwards. this is not recommended and only used for cleanup tasks. - * if this is passed as true, ignore_user_abort is called. if you don't want your processing to continue on cancel, - * you must detect this case when control is returned using connection_aborted. + * @return does not return, script terminated */ -function send_temp_file($path, $filename, $pathisstring=false, $dontdie=false) { +function send_temp_file($path, $filename, $pathisstring=false) { global $CFG; - if ($dontdie) { - ignore_user_abort(); - } - // close session - not needed anymore @session_write_close(); if (!$pathisstring) { if (!file_exists($path)) { header('HTTP/1.0 404 not found'); - error(get_string('filenotfound', 'error'), $CFG->wwwroot.'/'); + print_error('filenotfound', 'error', $CFG->wwwroot.'/'); } // executed after normal finish or abort @register_shutdown_function('send_temp_file_finished', $path); @@ -622,9 +616,6 @@ function send_temp_file($path, $filename, $pathisstring=false, $dontdie=false) { readfile_chunked($path); } - if ($dontdie) { - return; - } die; //no more chars to output } -- 2.39.5