Fix undefined variable in Status::getMessage()

If $shortContext and $longContext are false, and there
are errors, then $s is undefined.

Change-Id: Ie07f80b43a48a6fc4ed28b2c519f51fd32690bc8
This commit is contained in:
aude 2013-10-24 19:17:39 +00:00
parent 96a9a3e101
commit 92e284d3fa

View file

@ -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;
}