X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=1a33b76357aad9081d23436a4393eafbee7f2f08;hb=1a0474fa7bb681d18151edb38c2da11577d96bd2;hp=bb1951d52822759c9664a66ed3182a8481368c6e;hpb=a88aff710b197533e388943306d7af5f9706f1be;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index bb1951d528..1a33b76357 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2404,9 +2404,10 @@ function wfShellWikiCmd( $script, array $parameters = [], array $options = [] ) * @param string $mine * @param string $yours * @param string &$result + * @param string &$mergeAttemptResult * @return bool */ -function wfMerge( $old, $mine, $yours, &$result ) { +function wfMerge( $old, $mine, $yours, &$result, &$mergeAttemptResult = null ) { global $wgDiff3; # This check may also protect against code injection in @@ -2442,13 +2443,18 @@ function wfMerge( $old, $mine, $yours, &$result ) { $oldtextName, $yourtextName ); $handle = popen( $cmd, 'r' ); - if ( fgets( $handle, 1024 ) ) { - $conflict = true; - } else { - $conflict = false; - } + $mergeAttemptResult = ''; + do { + $data = fread( $handle, 8192 ); + if ( strlen( $data ) == 0 ) { + break; + } + $mergeAttemptResult .= $data; + } while ( true ); pclose( $handle ); + $conflict = $mergeAttemptResult !== ''; + # Merge differences $cmd = Shell::escape( $wgDiff3, '-a', '-e', '--merge', $mytextName, $oldtextName, $yourtextName );