If $shortContext and $longContext are false, and there
are errors, then $s is undefined.
Change-Id: Ie07f80b43a48a6fc4ed28b2c519f51fd32690bc8
}
} 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 );
$s = wfMessage( $shortContext, $wrapper );
}
}
+
return $s;
}