From: Andrew Garrett Date: Thu, 17 Jul 2008 12:30:40 +0000 (+0000) Subject: Fix handling of non-unified diffs in wfDiff X-Git-Tag: 1.31.0-rc.0~46470 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=34ba79f969541d8d26d2cec5925a4d0c87cba821;p=lhc%2Fweb%2Fwiklou.git Fix handling of non-unified diffs in wfDiff --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 7dbe0dd337..9e7b1fa01e 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1226,10 +1226,10 @@ function wfDiff( $before, $after, $params = '-u' ) { // Kill the --- and +++ lines. They're not useful. $diff_lines = explode( "\n", $diff ); - if (strpos( '---', $diff_lines[0] ) == 0) { + if (strpos( $diff_lines[0], '---' ) === 0) { unset($diff_lines[0]); } - if (strpos( '+++', $diff_lines[1] ) == 0) { + if (strpos( $diff_lines[1], '+++' ) === 0) { unset($diff_lines[1]); }