From: Kevin Israel Date: Sun, 13 Oct 2013 13:49:03 +0000 (-0400) Subject: Ensure that $call['args'] is set before using it X-Git-Tag: 1.31.0-rc.0~18529 X-Git-Url: http://git.cyclocoop.org///%22%40url%40//%22?a=commitdiff_plain;h=b82259ee3948e31c8a11f8d668527bf8c8848896;p=lhc%2Fweb%2Fwiklou.git 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 --- 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";