From b82259ee3948e31c8a11f8d668527bf8c8848896 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Sun, 13 Oct 2013 09:49:03 -0400 Subject: [PATCH] Ensure that $call['args'] is set before using it Fixes PHP Notice: Undefined index: args in /home/ki/Projects/mediawiki/ core/includes/Exception.php on line 755 when running code from maintenance/eval.php . Change-Id: Ic4a806232aadae0a60f5bc06de1604d9c5996e6f --- includes/Exception.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/Exception.php b/includes/Exception.php index 6724c4adec..b97697dedf 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -752,13 +752,15 @@ class MWExceptionHandler { $finalExceptionText .= $call['function']; } $args = array(); - foreach ( $call['args'] as $arg ) { - if ( is_object( $arg ) ) { - $args[] = 'Object(' . get_class( $arg ) . ')'; - } elseif( is_array( $arg ) ) { - $args[] = 'Array'; - } else { - $args[] = var_export( $arg, true ); + if ( isset( $call['args'] ) ) { + foreach ( $call['args'] as $arg ) { + if ( is_object( $arg ) ) { + $args[] = 'Object(' . get_class( $arg ) . ')'; + } elseif( is_array( $arg ) ) { + $args[] = 'Array'; + } else { + $args[] = var_export( $arg, true ); + } } } $finalExceptionText .= '(' . implode( ', ', $args ) . ")\n"; -- 2.20.1