From 4f23290816fe41acff23c2b7c46f3b0706c000b9 Mon Sep 17 00:00:00 2001 From: btongminh Date: Sat, 29 Dec 2012 21:39:54 +0100 Subject: [PATCH] wfMerge() now works if $wgDiff3 contains spaces Change-Id: Ia18012ee87fe45e292cf08542f5b0680d0b85371 --- RELEASE-NOTES-1.21 | 1 + includes/GlobalFunctions.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 6859bdadb1..80be060bcc 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -127,6 +127,7 @@ production. * (bug 41733) Hide "New user message" (.usermessage) element from printable view. * (bug 39062) Special:Contributions will display changes that don't have a parent id instead of just an empty bullet item. +* wfMerge() now works if $wgDiff3 contains spaces === API changes in 1.21 === * prop=revisions can now report the contentmodel and contentformat. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 208befe8fa..b06c1b842c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2936,7 +2936,7 @@ function wfMerge( $old, $mine, $yours, &$result ) { fclose( $yourtextFile ); # Check for a conflict - $cmd = $wgDiff3 . ' -a --overlap-only ' . + $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a --overlap-only ' . wfEscapeShellArg( $mytextName ) . ' ' . wfEscapeShellArg( $oldtextName ) . ' ' . wfEscapeShellArg( $yourtextName ); @@ -2950,7 +2950,7 @@ function wfMerge( $old, $mine, $yours, &$result ) { pclose( $handle ); # Merge differences - $cmd = $wgDiff3 . ' -a -e --merge ' . + $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a -e --merge ' . wfEscapeShellArg( $mytextName, $oldtextName, $yourtextName ); $handle = popen( $cmd, 'r' ); $result = ''; -- 2.20.1