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:
parent
96a9a3e101
commit
92e284d3fa
1 changed files with 9 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue