Fix handling of non-unified diffs in wfDiff
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 17 Jul 2008 12:30:40 +0000 (12:30 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 17 Jul 2008 12:30:40 +0000 (12:30 +0000)
includes/GlobalFunctions.php

index 7dbe0dd..9e7b1fa 100644 (file)
@@ -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]);
        }