[svn r13255] Added important comments about what the calling script should do upon return from the string_send_for_download() function

skala
Yannick Warnier 18 years ago
parent 9adc39c6c1
commit 16f3eec768
  1. 11
      main/inc/lib/document.lib.php

@ -396,7 +396,10 @@ class DocumentManager
} }
/** /**
* This function streams a string to the client for download * This function streams a string to the client for download.
* You have to ensure that the calling script then stops processing (exit();)
* otherwise it may cause subsequent use of the page to want to download
* other pages in php rather than interpreting them.
* *
* @param string The string contents * @param string The string contents
* @param boolean Whether "save" mode is forced (or opening directly authorized) * @param boolean Whether "save" mode is forced (or opening directly authorized)
@ -436,6 +439,9 @@ class DocumentManager
//fpassthru($fp); //fpassthru($fp);
echo $full_string; echo $full_string;
return true; return true;
//You have to ensure that the calling script then stops processing (exit();)
//otherwise it may cause subsequent use of the page to want to download
//other pages in php rather than interpreting them.
} }
else else
{ {
@ -458,6 +464,9 @@ class DocumentManager
header('Content-Disposition: inline; filename= '.$filename); header('Content-Disposition: inline; filename= '.$filename);
} }
echo($full_string); echo($full_string);
//You have to ensure that the calling script then stops processing (exit();)
//otherwise it may cause subsequent use of the page to want to download
//other pages in php rather than interpreting them.
return true; return true;
} }
} }

Loading…
Cancel
Save