From fbc7206444f463a238a43daf6ea679ed6c4d860b Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Mon, 15 Sep 2014 03:52:31 +0200 Subject: [PATCH] Prevent "Notice: Undefined index" in wfDiff Change-Id: I4cc7d10021a114a2035dd2d9274c2340242800cb --- includes/GlobalFunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] ); } -- 2.20.1