From: Marius Hoch Date: Mon, 15 Sep 2014 01:52:31 +0000 (+0200) Subject: Prevent "Notice: Undefined index" in wfDiff X-Git-Tag: 1.31.0-rc.0~14022 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=fbc7206444f463a238a43daf6ea679ed6c4d860b;p=lhc%2Fweb%2Fwiklou.git Prevent "Notice: Undefined index" in wfDiff Change-Id: I4cc7d10021a114a2035dd2d9274c2340242800cb --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index cfe9a87dc1..20398a59ef 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3179,10 +3179,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 ( isset( $diff_lines[0] ) && strpos( $diff_lines[0], '---' ) === 0 ) { unset( $diff_lines[0] ); } - if ( strpos( $diff_lines[1], '+++' ) === 0 ) { + if ( isset( $diff_lines[1] ) && strpos( $diff_lines[1], '+++' ) === 0 ) { unset( $diff_lines[1] ); }