foreach ( $params['images'] as $img ) {
$title = Title::newFromText( $img );
if ( !$title || $title->getNamespace() != NS_FILE ) {
- $this->setWarning( "\"$img\" is not a file" );
+ $this->addWarning( [ 'apiwarn-notfile', wfEscapeWikiText( $img ) ] );
} else {
$images[] = $title->getDBkey();
}