X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=66e244082eb5fa96493f1368b103840f34e4a7f4;hb=99b84272c21b84c4861ef41f1078a5cd38689782;hp=d5c65539588ac3a0b6380f8ffa2aecbfc2b6ed75;hpb=f826f2f5f6facdce2c92dcb9e70bb0cf20ff9db0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d5c6553958..66e244082e 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2499,14 +2499,6 @@ function wfShellExec( $cmd, &$retval = null, $environ = [], $eintr = defined( 'SOCKET_EINTR' ) ? SOCKET_EINTR : 4; $eintrMessage = "stream_select(): unable to select [$eintr]"; - // Build a table mapping resource IDs to pipe FDs to work around a - // PHP 5.3 issue in which stream_select() does not preserve array keys - // . - $fds = []; - foreach ( $pipes as $fd => $pipe ) { - $fds[(int)$pipe] = $fd; - } - $running = true; $timeout = null; $numReadyPipes = 0; @@ -2539,9 +2531,8 @@ function wfShellExec( $cmd, &$retval = null, $environ = [], break; } } - foreach ( $readyPipes as $pipe ) { + foreach ( $readyPipes as $fd => $pipe ) { $block = fread( $pipe, 65536 ); - $fd = $fds[(int)$pipe]; if ( $block === '' ) { // End of file fclose( $pipes[$fd] );