From: aude Date: Thu, 24 Oct 2013 19:17:39 +0000 (+0000) Subject: Fix undefined variable in Status::getMessage() X-Git-Tag: 1.31.0-rc.0~18403^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=92e284d3fa62f45e20fed34c4359c575481d583c;p=lhc%2Fweb%2Fwiklou.git Fix undefined variable in Status::getMessage() If $shortContext and $longContext are false, and there are errors, then $s is undefined. Change-Id: Ie07f80b43a48a6fc4ed28b2c519f51fd32690bc8 --- diff --git a/includes/Status.php b/includes/Status.php index ab242011c7..928f8ebd61 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -238,8 +238,14 @@ class Status { } } else { $msgs = $this->getErrorMessageArray( $this->errors ); - $wrapper = new RawMessage( '* $' . implode( "\n* \$", range( 1, count( $msgs ) + 1 ) ) ); - $wrapper->params( $msgs )->parse(); + $msgCount = count( $msgs ); + + if ( $shortContext ) { + $msgCount++; + } + + $wrapper = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) ); + $s = $wrapper->params( $msgs )->parse(); if ( $longContext ) { $s = wfMessage( $longContext, $wrapper ); @@ -249,6 +255,7 @@ class Status { $s = wfMessage( $shortContext, $wrapper ); } } + return $s; }