php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #79410
Patch system_4095_bytes.patch revision 2020-03-25 08:23 UTC by cschneid@php.net
revision 2020-03-23 20:41 UTC by cschneid

Patch system_4095_bytes.patch for Program Execution Bug #79410

Patch version 2020-03-25 08:23 UTC

Return to Bug #79410 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: cschneid@php.net

diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index cdf983787b..3b0e0a034f 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -157,6 +157,13 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value)
 			b = buf;
 		}
 		if (bufl) {
+			/* output remaining data in buffer */
+			if (type == 1 && buf != b) {
+				PHPWRITE(buf, bufl);
+				if (php_output_get_level() < 1) {
+					sapi_flush();
+				}
+			}
 			/* strip trailing whitespaces if we have not done so already */
 			if ((type == 2 && buf != b) || type != 2) {
 				l = bufl;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC