Prechádzať zdrojové kódy

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

Yannick Warnier 17 rokov pred
rodič
commit
16f3eec768
1 zmenil súbory, kde vykonal 10 pridanie a 1 odobranie
  1. 10 1
      main/inc/lib/document.lib.php

+ 10 - 1
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;
 		}
 	}