From 16f3eec7680467dba3334f2246097bfcda198ed8 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 26 Sep 2007 07:18:56 +0200 Subject: [PATCH] [svn r13255] Added important comments about what the calling script should do upon return from the string_send_for_download() function --- main/inc/lib/document.lib.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index ebe119e5a0..d9bb948e36 100644 --- a/main/inc/lib/document.lib.php +++ b/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 boolean Whether "save" mode is forced (or opening directly authorized) @@ -436,6 +439,9 @@ class DocumentManager //fpassthru($fp); echo $full_string; 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 { @@ -458,6 +464,9 @@ class DocumentManager header('Content-Disposition: inline; filename= '.$filename); } 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; } }